Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: Field data stripped when using add ons designed to format title from field data

Status Resolved
Add-on / Version Publisher 1.4.0
Severity Critical
EE Version 2.8.1

mike stecker

Jul 02, 2014

I developed a fairly large site for a hospital (2000+ entries) a while back and they now want to add multi-language support, so on Monday we purchased Publisher for use on the site (under the account maven20 on Devot:EE).

Quickly I ran into an issue when I update entries that I use another addon for modifying the entry title based off field data where the data in the fields would be stripped down to the first letter for some reason.

I have tried this with two add ons that do the same thing: MX Title Control (free) & Title Master (paid) and it happens with both add ons.

Basically, I have a entry with separate fields for first name, middle name, last name and their “honorific suffix” (this is for a physician directory, so these would be M.D., PhD, etc). I had be using Title Master to form the entry titles using a setting similar to:

{first_name} {additional_name} {last_name} {honorific_suffix}

When I went to check my settings in Title Master, I am now no longer able to see my settings due to a EE 2.8 upgrade issue. After spending some time digging, I see that the maker of Title Master seems to no longer be supporting the addon… so I decided to switch to the free MX Title Control addon. Upon configuration of that addon I was noticing the same issue in conjunction with Publisher. Without Publisher, it works as expected. With Publisher installed, the data is now stripped down in those fields to just their first letter.

Telling Publisher to ignore this channel seemed to resolve the issue but we would like to have Publisher add languages to this channel so I’d like to get this resolved.

I’m not sure if this error lies with Publisher or MX Title Control, but I’d like to get this worked out ASAP as it is something needed for this section of our client’s website. Below is a link to the issue I posted on MX Title Control, but the developer doesn’t have a copy of Publisher to test on his end.

https://github.com/MaxLazar/mx-title-control/issues/3

Of note, I do not see any error messages anywhere, neither in the console nor any PHP errors displayed. I think it’s all happening on save.

Also, I haven’t rolled this out to a public server yet since the errors I am having are too far reaching. I’m currently only working locally. If you want, I can send you a copy of the Git repo for the site as well as a DB dump to test, but it is fairly large. You would have to set up a virtual host at a specific domain locally to test (using Focus Labs Master Config).

Let me know if I can help out in any way chasing this issue down.

#1

BoldMinded (Brian)

Mike, this sounds like something Max is going to have to resolve as all Publisher is doing is grabbing the POST data, and MX Title is probably saving the value directly to the native table instead of modifying the POST data.

#2

mike stecker

Figured. Would it be possible for you to provide him with a copy somehow so he can test on his end? Or, is it possible for me to give him my copy without violating my license somehow?

#3

mike stecker

Well, maybe I can take a crack at it too since this addon is open source on GitHub…

#4

BoldMinded (Brian)

I can gift him a copy if you get him to email me his Devot:ee username. His screen name isn’t coming up in the menu for me to gift it.

#5

mike stecker

I just googled him and it came up as: http://devot-ee.com/developers/max-lazar

#6

BoldMinded (Brian)

It shouldn’t be that difficult to add support for. Around line 242 it has this:

ee()->db->where('entry_id', $entry_id);
ee()->db->update('channel_titles', $meta);

Just change to:

if (isset(ee()->publisher_lib)) {
    ee()->db->where('entry_id', $entry_id);
    ee()->db->where('publisher_lang_id', ee()->publisher_lib->lang_id);
    ee()->db->where('publisher_status', ee()->publisher_lib->status);
    ee()->db->update('publisher_titles', $meta);
} else {
    ee()->db->where('entry_id', $entry_id);
    ee()->db->update('channel_titles', $meta);
}

Untested, but it shouldn’t be much more than that.

#7

BoldMinded (Brian)

Or instead of just passing the whole $meta array, just do this so it only modifies what it needs to.

ee()->db->update('publisher_titles', array(
    'title' => $meta['title'],
    'url_title' => $meta['url_title']
));
#8

mike stecker

Thanks, I’ll look into this today, mess around with the MX Title code on Github and report back when I get it working.

#9

mike stecker

OK, I tried… but it’s not working. I’ll just have to wait for the MX Title developer to get back to me…

I updated the lines you mentioned earlier to your suggestions. No PHP errors are being reported but the title isn’t being updated still and the text from the fields that “build” the title are being stripped down to their first letter still.

FYI, here is the updated code I used:

if (isset(ee()->publisher_lib)) {
   ee()->db->where('entry_id', $entry_id);
       ee()->db->where('publisher_lang_id', ee()->publisher_lib->lang_id);
       ee()->db->where('publisher_status', ee()->publisher_lib->status);
   ee()->db->update('publisher_titles', array(
        'title' => $meta['title'],
        'url_title' => $meta['url_title']
   ));
  } else {
   ee()->db->where('entry_id', $entry_id);
   ee()->db->update('channel_titles', $meta);
  }
#10

BoldMinded (Brian)

Closing as the issue should be resolved in the other add-ons. Not something I can fix in Publisher.

Login to reply