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: Publisher / Matrix Bug?

Status Resolved
Add-on / Version Publisher 1.0.12
Severity Critical
EE Version 2.5.2

Mike C

Nov 18, 2013

Hi -

I’m guessing this is a bug…

We have an entry (CP > Content > Edit > Multi Entry > Our People) in the default language (EN) which has a Matrix field (2.4.1) and has some other languages already saved. We go into the EN entry and add a couple rows with some data - and publish that. We then go into another language for that entry and but the 2 rows added in EN are not in the other languages. Those should be there, though, correct?

If so, I guess we have a bug - and if not, then how would we be able to add more data in non-default languages?

Thanks,
Mike

#1

BoldMinded (Brian)

Those rows would only be there if the Matrix persistence setting was turned on (check the Publisher settings page).

Also, you’re using a pretty old version of Matrix. If I were to debug this you’ll need to upgrade. Also, Publisher 1.0.15 adds some better support for content fallback.

#2

Mike C

Hi Brain -

Persistence is on already.

As to upgrading, a couple points in advance of potentially doing that:

  • You may not recall but we went through a lot of tickets and bug fixes with you starting back at Pub 1.0.1 I think on this project. Anyway, during that process I believe we did a Matrix update for another issue and it spawned more issues and we rolled back. So that said, we can try it again but I’m not too confident.

  • Upgrading Publisher is something that is not as easily explored for us now. We had to modify it a fair bit to get it to work seamlessly with Solspace Search (as well, it looks like Pub is not compatible with EE 2.5 anymore). That said, if we tested the Matrix update and the problem persisted, could you explore the 1.0.12 version on our site and perhaps we could patch in a fix - or at least get some direction from on where to address the issue?

Thanks, Mike

#3

BoldMinded (Brian)

I remember. Do you have a staging or dev sandbox you can upgrade in? As for the 2.5 support, there isn’t anything in Publisher to make it not work in 2.5, just as long as you’re not using the native/old relationship field. I still have a dev sandbox that is 2.5.5 and use it from time to time and it works.

As for patching an old version of Publisher, it isn’t viable for me to do that… I’d rather be able to fix the issues permanently and get them into the latest version.

#4

Mike C

Do you have a staging or dev sandbox you can upgrade in?

Yes, this project is still in STAG. The attached credentials are for that. We’ll try a Matrix update and see if that addresses the issue - or adds new ones and get back to you.

As for the 2.5 support, there isn’t anything in Publisher to make it not work in 2.5, just as long as you’re not using the native/old relationship field.

Ok - are you suggesting we should try the 1.0.15 upgrade also? It means integrating our updates into it (which we’ve done once previously) but would prefer to not do if it’s more likely this needs to be addressed in a new build.

As for patching an old version of Publisher, it isn’t viable for me to do that…

I understand re: adding a proper fix to Publisher. I guess my point was whether you can provide a bit of insight as to where that fix is on a new build so we can integrate our Pub codebase with your updates more easily.

#5

Mike C

Hi Brain -

Just a quick update. Due to items on the client side, it looks like we’re going to be launching this project first with that issue still in place and return to it on STAG later to address it. As such, I don’t expect us to move this issue forward until sometime next week at the earliest.

In the meantime, let me know your responses to my last post and just know we’ll leave this ticket open and unattended until we are past our launch.

Thanks, Mike

#6

BoldMinded (Brian)

Sounds good.

#7

Mike C

Hi Brian -

We’ve pushed this project live and have STAG available again to troubleshoot this issue. I updated Matrix to the latest version and now we get the errors below on both the front end and in the CP for entries with a Matrix field type. See an example here: http://staging.cadex.com/en/about-cadex/our-people

Error Number: 1054

Unknown column 'is_draft' in 'where clause'

SELECT row_id, col_id_42, col_id_43, col_id_44, col_id_45, col_id_46, col_id_47, col_id_48, col_id_49, col_id_50, col_id_51, col_id_52 FROM exp_matrix_data WHERE field_id = 59 AND publisher_status = "open" AND publisher_lang_id = 1 AND entry_id = 1002 AND is_draft = 0 ORDER BY row_order ASC LIMIT 100

Filename: third_party/publisher/models/publisher_query.php

Line Number: 74

If you can let me know about timing on looking at this ASAP that would be much appreciated. We have other work queued up behind this specific to this website so a heads up would let us better manage our schedule on those.

And of course, beyond this issue in upgrading Matrix is the original issue regarding adding/removing Matrix rows in the original language - and that not being reflected in other languages.

Thanks, Mike

#8

BoldMinded (Brian)

Mike, sorry for this, but I have family in town and won’t be able to trouble shoot this for a few days.

#9

Mike C

Ok - we’re reverting the site to the previous version of Matrix so that we can work on other items. I’ll follow up next week and hopefully we can get this issue resolved.

#10

BoldMinded (Brian)

After reading this again the is_draft error is definitely not related to publisher. That column is used by BWF. I’ve encountered the same error before. Make sure you run the update scripts or just add that column manually to the table.

#11

Mike C

Sorry but BWF is not installed on this site - nor never has been. In fact, I’ve never used used it on a project so I don’t think that’s it…

#12

BoldMinded (Brian)

It doesn’t matter if BWF is installed or not, its definitely a Matrix issue. I’ve had the same error on other sites that don’t even have Publisher installed. Just add the column is_draft table and the error will go away.

#13

Mike C

Ok - understood. We’ll circle back after some other updates and after we’ve resolved this Matrix issue - and see if the original bug in this thread still persists.

#14

Brian Litzinger

Mike, I just released 1.1 which has some Matrix fixes, see if it solves the problem.

#15

Mike C

Thanks Brian. We haven’t looked at this further yet as we’re working on other items.

#16

Mike C

Further to an eventual update Brian, as mentioned earlier, in order to do so, we’re going to have to integrate our changes to Publisher with your updates - which might not be very easy. I was curious if, by chance, you have a commit history for this or something else we might be able to use in terms of looking back through your changes since 1.0.12?

#17

BoldMinded (Brian)

There are 342 commits since 1.0.12… are you sure you want that list?

#18

Mike C

Ack. Hold off for now - but thanks for being willing to pass that along.

#19

BoldMinded (Brian)

Yeah, it includes all the trial and error work for the Grid support.

I should have squashed commits better :/

#20

Mike C

Hi Brian -

We’ve finally gotten through some other stuff and have returned to this. We have updated our STAG install with Matrix 251 and the latest, vanilla (no changes by us) Pub 112 and the row bug described still exists. You can see a sample here: http://staging.cadex.com/en/matrix-issue

The EN version has 4 rows and the DE version (if you switch to that) has 3 rows. You’ll find the entry in the CP at: Content > Edit > Multi Entry (id 1006). To recap, I went into the CP, created that new entry in EN with 3 initial rows and saved it. I then went to DE and made a couple tweaks and saved the entry. I then went back to EN and added a 4th row and saved. I go to the DE version and there is no fourth row. I have been able to replicate this behaviour on other entries also.

Further - and a bit odd - is not every Matrix instance exhibits this behaviour. On that sample entry, the last Matrix field on the entry form (Sidebar) does not exhibit this issue. You can see 2 initial rows added and then a 3rd after and it works as expected.

We’ll stay out of that STAG install while you look at things.

Thanks, Mike

#21

BoldMinded (Brian)

Sent a new build. The FTP info attached to the ticket doesn’t seem to be working.

#22

Mike C

Hi Brian -

A few items to follow up:

FTP Looks like I just had a typo in those credentials - updated and they should work.

Pub 113 Upgraded STAG to that - no change in the row issue.

Matrix While testing, I noticed a serious Matrix issue that might mean we need to downgrade that version. They removed support for a deprecated method in Matrix 2.5.7 for dealing with date fields which is rendering some pages of STAG unusable (example: http://staging.cadex.com/en/news/press-releases). I cannot find a fix - and the Matrix docs state it’s still compatible with EE 2.4 and up. I’ve put in a support request to P&T on this but wonder whether we can downgrade to Matrix 2.5.6 and still address this Publisher issue if P&T cannot offer a fix? Upgrading EE to 2.7.2 is really not an option for us unfortunately. Thoughts?

Thanks, Mike

#23

BoldMinded (Brian)

Matrix hasn’t had Publisher breaking changes in almost a year, so downgrading is probably fine. Its most likely a Publisher issue if any.

#24

Mike C

Ok - P&T just sent me a latest build of Matrix. Do you have a preference as to us downgrading to 2.5.6 or trying their latest build (which they think will fix the issue above)? Let me know - and we’ll do either first.

#25

BoldMinded (Brian)

If it fixes your other issue, use their latest build. I doubt it’ll affect Publisher in any way.

#26

Mike C

Updated to the latest Matrix build and the date issue is now gone. The Pub row bug still exists though, so I’ll leave that in your hands now. STAG has the latest Matrix and Pub 113 on it now.

Thanks, Mike

#27

BoldMinded (Brian)

Mike, try it now, appears to be working.

#28

Mike C

Thanks Brian but there are definitely still issues. I checked one or two entries and they seemed ok but in testing further, it became apparent the problem persists.

I added a row to this existing entry in EN (http://staging.cadex.com/en/technology/our-patents) but it does not show up in the DE version.

So then I tried a from-scratch test again, creating a new entry (http://staging.cadex.com/en/matrix-issue-2). I then went to create the DE version and here’s what I get on the front end now for that after saving the German version (http://staging.cadex.com/de/matrix-issue-2): {”sEcho”:0,”iTotalRecords”:”0”,”iTotalDisplayRecords”:”0”,”aaData”:[]}

#29

BoldMinded (Brian)

Bollocks. I’ll give it another look tonight. At least now I know which area of code is causing the issue.

#30

BoldMinded (Brian)

Sent another build with slightly revised logic. I tested this on a different environment and re-saved an entry multiple times from language to language and it showed the correct rows each time.

#31

Mike C

Pub 113 c installed Brian.

The error above re: saving an entry is still there ({”sEcho”:0,”iTotalRecords”:”0”,”iTotalDisplayRecords”:”0”,”aaData”:[]} for http://staging.cadex.com/de/matrix-issue-2) - though perhaps it shouldn’t be with new entries (I haven’t tried adding another new one). Should it fix that existing entry?

The original row bug remains. See this test entry: http://staging.cadex.com/en/matrix-issue-2. It has an EN row not showing up in DE in the CP.

As well, I get these errors now on the front end if I hit the site without explicitly adding a language code in my url (ie. staging.cadex.com):

A PHP Error was encountered

Severity: Notice

Message: Undefined variable: new_url

Filename: Publisher/Publisher_session.php

Line Number: 702

A PHP Error was encountered

Severity: Notice

Message: Undefined variable: new_url

Filename: Publisher/Publisher_session.php

Line Number: 704

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /nfs/c07/h04/mnt/112936/domains/system252_stag/codeigniter/system/core/Exceptions.php:170)

Filename: helpers/Publisher_helper_url.php

Line Number: 79
#32

BoldMinded (Brian)

What is generating this response?? {“sEcho”:0,“iTotalRecords”:“0”,“iTotalDisplayRecords”:“0”,“aaData”:[]}

#33

BoldMinded (Brian)

The new_url error will be fixed in the next build.

#34

Mike C

That response is being generated when trying to visit this page: http://staging.cadex.com/de/matrix-issue-2

That page was the DE language version I was trying to save when doing another test for the Matrix row bug.

#35

BoldMinded (Brian)

Can you remove everything in that matrix template except the entries tag and matrix loop. That an EE datatables response… why on earth would it be in the source on the front-end of the site? It shouldn’t have any influence on Publisher and should be irrelevant.

#36

Mike C

Ok - I stripped it back - and even ended up stripping it back to literally just the string ‘test’ in the template - nothing else at all.

In all cases, the EN version of the URL returned what would be expected and in all cases, the DE version of the url continued to return: {”sEcho”:0,”iTotalRecords”:”0”,”iTotalDisplayRecords”:”0”,”aaData”:[]}

FYI, I have restored the template to it’s original state.

#37

Mike C

Is it worth creating a new entry at this point to test that behaviour (ie. to see if it happens on other entries)?

#38

BoldMinded (Brian)

Creating a new entry may help for a clean start. My biggest question is why is it returning what is normally an ajax requests from the datatables plugin that is only called in the CP?

#39

Mike C

Hi Brian -

Sorry, I can’t answer your second question - I’m not really a developer - mostly just a front end guy. As to a clean entry, I’ve run a few tests. I created two more - with the exact same behaviour (fyi, one of those channels did not have a matrix field in it). I also tried editing two previously existing entries in both respective channels and those were ok.

This issue did not exist in before updating to Pub 113 (and then 113c) - and those are the only updates since then. When updating to Pub 112 and the latest Matrix build, all was fine at that point in regards to this specific issue.

And now further, I’m seeing other entry weirdness. While testing some existing entries, I edited the DE version of an entry (ID 233) and when I got the preview returned, it was all English. You can see the DE version of the page here: http://staging.cadex.com/de/privacy

But if you check the CP to edit the German, it still shows the German content - and I see that German content in the exp_publisher_data table.

#40

BoldMinded (Brian)

The {“sEcho”:0,“iTotalRecords”:“0”,“iTotalDisplayRecords”:“0”,“aaData”:[]} issue is because those entries were assigned the adapters template. You should probably add the templates field back to the entries so it is properly assigned.

I reverted my Matrix change and it appears to be working. Adding additional rows to the english entry show up in the translated entry in the CP and front-end.

I just re-saved the privacy page in german and it is appearing fine now, not sure what happened there.

#41

Mike C

Thanks for looking at this Brian.

The matrix bug does seem fixed finally. Whew.

One point to make re: the pages template. You are correct that was the issue but those entries were getting assigned that way due to something that changed in Publisher. If you create an entry, it will pick the default template for that channel as defined in the Pages modules settings (which is how EE should work). However, when you go to create a new language version, Publisher is not honouring that Pages module setting and is defaulting to the first template. Not trying to be unkind but that seems like either a bug or oversight in how this works. Publisher seemed to honour that setting previously and I guess I’d argue it still should.

I can obviously re-enable the field in my various entry forms and instruct clients to make certain they select the correct template when creating a new language version - but it doesn’t seem like an ideal workflow. Perhaps you’ll consider having Publisher pull across the selected template from the primary language entry like it tries to do with other fields.

#42

BoldMinded (Brian)

Mike, you’re right it should use the default template for the channel. I just sent you a build that should do this.

#43

Mike C

Thanks Brian. Two items:

On STAG, those php errors are now coming up again (without having upgraded to your latest build). Go to: http://staging.cadex.com/ to see them. They disappear if you enter a language code. I thought I’d mention that first before pushing through the latest

On another front, the PROD version of this site is throwing an error now:

Fatal error: Call to undefined method Publisher_entry::is_ignored() in /nfs/c07/h04/mnt/112936/domains/system252/expressionengine/third_party/publisher/libraries/Publisher/hooks/Publisher_matrix_hooks.php on line 87

The client was working on an update when they had connectivity issues with the host while saving an entry and got some kind of DB error back (they did not copy the error). We’re in the process of getting a db backup restored as that seems to be the likely issue. We cannot access and entries in the CP that use Matrix… just curious on your opinion on this that might shed light on things if the DB restore does not work. Thanks.

#44

BoldMinded (Brian)

You might have to restore the publisher_matrix_hooks file from the 112 version of Publisher… I may have uploaded a file to the wrong spot on accident?

As for the staging error, that is fixed in the new build I emailed this morning.

#45

Mike C

Yes, that was it.

Let me know about those other php errors on STAG - maybe related to uploading the hook file to PROD by accident?

#46

BoldMinded (Brian)

The error on staging should be fixed by uploading the new Publisher_session.php file.

#47

Mike C

Thanks Brian. Everything is working with your latest build except for the pages template selection. It is still defaulting to the first selection on other languages for me. I’ve tried testing multiple entries and channels and it never preserves the primary language’s template selection.

#48

BoldMinded (Brian)

Are you positive the models/publisher_entry.php and models/publisher_template.php files were updated? I tested this morning with a hidden template selector in the Pages channel and it correctly assigned the default template.

#49

Mike C

I replaced everything completely with the build you sent this AM (publisher-113-20131219). And just now I re-uploaded just those two files from that build. Same behaviour. You can log into the CP to confirm but I’m definitely seeing that behaviour still.

#50

BoldMinded (Brian)

I just did 2 tests, one in the adapters channel and one in multi-entry. I dumped the value just before post and it is getting the default template properly. There are several channels that don’t have a default template defined in your config. Everything indicates its working.

#51

Mike C

I don’t know what to say. Well, first, I’m not testing any channels that haven’t been assigned a default template. For those that are, it definitely is not working. Maybe you you can explain what you’re doing to get it to work?

I’ll attach two screens of my efforts showing the initial EN entry creation and then what I see in the CP when I switch languages.

What I am doing is:

  1. Create new multi-entry entry
  2. enter some data (see in my first screen the templates drop down has pre-populated with the correct template)
  3. save the entry
  4. go to edit the entry again
  5. switch to another language, and;
  6. the templates drop down now shows ‘adapters’ the first template in the list

Shouldn’t that have ‘multi-entry’ as it’s value?

Is there something wrong with this process or are you dong something different?

Thanks, Mike

#52

Mike C

Hi Brian -

There are yet further issues around Pages with these latest updates. If I attempt to publish an entry in a channel that is not managed by the Pages Module (you could try the Subscriptions entry/channel) I now get an error (see another attached screen) about a duplicate Pages URI (which is the default Pages placeholder uri).

This is obviously not supposed to happen. If a channel isn’t set up with a default template, this field should be ignored, correct?

This behaviour didn’t previously exist and doesn’t on PROD with Publisher 111.

#53

BoldMinded (Brian)

The template issue should be fixed now. Looking into the URI issue….

#54

BoldMinded (Brian)

The Pages module isn’t like Structure in which you can enable it on a per-channel basis. Once its enabled its present on all channels… there isn’t an option to manage this. There are currently entries on your site with those values saved as the URI. All it takes is one entry to be saved with that as its URI value to start throwing this error b/c its now in the pages list. Entries 232 and 1018 are the ones that have that value right now and since they exist EE throws this error. This isn’t a Publisher issue. Correct the URI values on entries 232 and 1018 and it should go away.

#55

Mike C

Hi Brian -

The template is is fixed - thanks.

However, I have to disagree with your assessment of the page uri errors. They do appear to be a Publisher-related issue. Let me lay this out:

Unfortunately, I had deleted entry 1018 but entry 232 does not have “example/pages/uri” entered as it’s URI. It is ‘sitemap’ for every language when looking at the CP. I’m not certain where you’re seeing ‘example/pages/uri’? I cannot find an occurrence of the string ‘example/pages/uri’ in any table other than exp_publisher_titles - is that where the pages list it exists then? If so, why do I not see that as it’s value in the CP?

Further, I can publish as many entries in the primary language in channels with no pages template assigned without issue. As soon as I go to any of those and attempt to publish an alternate language version, I get the error (sample screen attached). If what you say in the comment above is true (and I’m assuming it is), why am I able to publish EN versions without issue? If there is an entry saved with ‘example/pages/uri’ then according to what you say above, I shouldn’t be able to publish primary language versions either and should see these errors for primary language attempts also - but I don’t. Isn’t that correct? Or are you saying there is an issue that only affects alternate language versions? But in either case, that would seem to point to a Publisher-related issue.

Go into Content > Publish > Subscriptions or Content > Publish > File Groups and publish some EN entries. Those should all work fine. But as soon as you try to publish alternate language versions, you’ll get that error. That just does not make sense to me - why do EN ones work but no other languages?

Thanks, Mike

#56

BoldMinded (Brian)

I just ran some tests locally and Publisher will not save a page if its URI matches that of the lang(‘example_uri’) key (which is /example/pages/uri) in any language. If you visit the home page of your staging site right now you’ll see a var_dump of the site_pages array, which contains a few entries of /example/pages/uri. https://www.evernote.com/shard/s9/sh/c8a2debc-8d13-4251-912a-d1906cca4230/a23c3a1a4968d13e928288a53308edf6

Edit that sitemap entry and watch the URI field, it shows as /example/pages/uri for a second, then Publisher updates the value with javascript so it matches the default language if it doesn’t have a value. Re-save that entry in each language and see if that fixes the issue.

#57

BoldMinded (Brian)

BTW, you can turn off that debugging by changing $debug = FALSE in ext.publisher.php

#58

Mike C

Thanks Brian. That’s understood and that did fix the issue. A couple questions to better understand things:

  1. STAG was created from PROD where that issue does not exist. Since we’ve been working on STAG, I know for certain no one had been in that 232 entry to look at or change anything. I’m just curious if you could speculate as to whether any of the Publisher-specific updates could have had any impact on that? I’m just curious because I’m scratching my head as to how that came to be.

  2. That debugging array that’s getting spit out - where is it coming from? I thought it might have been from the column site_pages in the table exp_publisher_site_pages but when I looked in those fields in the DB, I could not find that ‘example/pages/uri’ string. Is it getting built from that and exp_publiser_titles? Just curious.

At this point, I think all is working. I’m going to do a bit more thorough testing just incase.

Thanks for helping track down these issues - and have a good holiday. I’ll close out the ticket once we wrap up testing and push these updates to PROD.

Cheers, Mike

#59

Brian Litzinger

There were some issues with the pages uri a few versions ago, so its possible the error stems from an earlier release.

The debug array comes from the publisher_site_pages table. I didn’t look directly at the db table so not sure what could be up with that. Lets just keep an eye on that issue and if it arises again I can take another look at it.

#60

Mike C

Ok - thanks. It is a bit bit odd re: that table. I definitely could not find that string in any of those fields when I dumped them from the db. We also had a previous issue there (that looks like got fixed in the latest pub updates) where we’d delete an entry and it would not be removed from that array. That still exists in PROD where Pub 111 is - and we were having to go in there and remove the entry manually from that array.

Login to reply