Be sure to checkout our newest add-on Reading Time Pro!

Compatibility updates:

  • Publisher is EE5 compatible, but it does not currently support the Fluid field (it's in the works).

Ticket: Issue with blocks and relationships

Status Resolved
Add-on / Version Publisher 2.10.7
Severity
EE Version 4.3.6

Aaron Jay

Feb 06, 2019

Hi Brian,

I have an issue with Blocks and a two level deep relationship.

The link My Test Publication has a different file attached for each language, but it seems that whichever language is saved last in the back end, that version of the file is shown for both languages.

It’s a slightly convoluted set up.  But it’s a Bloqs field, with a relationship in it, then in the related entry there’s another relationship to the file itself.

Screen Shot 1 is the starting point, the bloq with the relationship

Screenshot 2 is the next relationship

Screenshot 3 then is the final link with the file in it

 

#1

BoldMinded (Brian)

Feb 07, 2019

Aaron, its going to be a few days until I can look into this due to the setup of trying to replicate it. It may help if you share the template code you’re using (remove all html, css etc, just bare bones EE template code). It would also help if you replicate this in your site in some debug/test templates, again removing all extra html and css, and keeping only the EE template code necessary to replicate the issue, and please share the template names used to do this so it’s clear to me when I login to the CP to take a look.

#2

BoldMinded (Brian)

Feb 07, 2019

Is this site running Publisher? The same site from your other ticket? https://boldminded.com/support/ticket/1926

If so, backup your database and un-install Publisher, then see if the issue still occurs. Or better yet, setup a brand new EE environment with only Bloqs installed and try to replicate it there. I want to know if this looks like a Bloqs issue or Publisher issue (or both).

#3

Aaron Jay

Feb 07, 2019

Comment has been marked private.

#4

BoldMinded (Brian)

Feb 07, 2019

Aaron, thanks for this. I’ll try to replicate this locally in the next few days (kind of busy right now) and see what I can figure out.

#5

Aaron Jay

Feb 07, 2019

Comment has been marked private.

#6

BoldMinded (Brian)

Feb 07, 2019

No, it’ll take longer for me to spin up an environment with those files than it would to just do it in my current dev environment. In more complicated scenarios it might help, but this one is pretty straight forward. Thanks though.

#7

BoldMinded (Brian)

Feb 10, 2019

I was not able to replicate this. I had a channel setup with a Bloqs field, containing a block that has a Relationship atom field, linked to another entry, and that entry has a Relationship field to another entry, which contains a file field. The file field always displayed the correct file, regardless of what the save patterns were.

You said “whichever language is saved last in the back end, that version of the file is shown for both languages”, but you didn’t say which entry was being saved… was it the entry containing the file, or one of the other entries with the Relationship fields? Are you able to create a video of this issue as you’re seeing it so I can see exactly what you are seeing?

#8

Aaron Jay

Feb 11, 2019

HI Brian,

That’s right, it’s the entry that contains the file that when saved display that version in both languages. 

No problem, what’s the best way to get a video to you?

#9

BoldMinded (Brian)

Feb 11, 2019

The easiest way is if you can put it on Dropbox or a similar service, and just link to the file here in a private comment.

#10

Aaron Jay

Feb 12, 2019

Comment has been marked private.

#11

Aaron Jay

Feb 15, 2019

Comment has been marked private.

#12

BoldMinded (Brian)

Feb 15, 2019

Sorry, I haven’t had a chance to look into this since my last comment.

#13

Aaron Jay

Feb 15, 2019

Hi Brian,

No problem, let me know when you get a chance. 

It might be related, but I’m also seeing this issue is other parts of the site that don’t use blocks and relationships.  Even basic text fields, if you save the entry in the translated language, it shows the translation version for both languages on the front end.

#14

BoldMinded (Brian)

Feb 16, 2019

I’m still unable to replicate this. I noticed in your video you’re using EE 4.3.8, and you originally reported the issue in 4.3.6. Is there any reason you haven’t upgraded to 5? If your site is running on 4, it should run on 5 just fine. Try replicating the issue in 5 and see what happens.

#15

Aaron Jay

Feb 18, 2019

Comment has been marked private.

#16

BoldMinded (Brian)

Feb 18, 2019

I think at this point the next step is to provide FTP access to that dev server (edit the ticket and add info in the provided fields). From the looks of the video it looks like it’s a clean version of EE and the add-ons with minimal entries and template tags to reproduce the error, which is good. I don’t know how much I can determine from FTP access b/c debugging is hard and slow over FTP, but I’ll give it a look. If I can’t figure it out with FTP access, you may have to package up the site with all the files and a database dump so I can set it up locally and debug it. This isn’t the most ideal situation b/c I don’t use MAMP and would need to spin up a vagrant box to run it locally.

#17

BoldMinded (Brian)

Feb 18, 2019

Actually the CP login you provided looks like a full site, so you’d need to put the clean version of the site somewhere I can login to it.

#18

Aaron Jay

Feb 18, 2019

Comment has been marked private.

#19

BoldMinded (Brian)

Feb 18, 2019

The FTP info you provided doesn’t work.

#20

BoldMinded (Brian)

Feb 18, 2019

It is loading data from EE’s native tables, not Publisher’s tables on the front-end. What is causing this, I don’t know, b/c this is certainly something I haven’t seen in a long, long time. When the FTP works I’ll hopefully be able to get a better idea of what it is. It looks like everything installed correctly, but it’s not acting that way. Something is up with this environment, otherwise I’d be getting similar reports from other people, and be able to replicate it myself.

#21

Aaron Jay

Feb 19, 2019

Comment has been marked private.

#22

BoldMinded (Brian)

Feb 19, 2019

FTP works, but now the CP password is incorrect.

#23

Aaron Jay

Feb 19, 2019

Comment has been marked private.

#24

BoldMinded (Brian)

Feb 19, 2019

Took me 3 hours to track down, but I think I got it. New build in the next comment.

#25

BoldMinded (Brian)

Feb 19, 2019

Comment has been marked private.

#26

Aaron Jay

Feb 20, 2019

Comment has been marked private.

#27

BoldMinded (Brian)

Feb 20, 2019

Are you sure? I tested it again and it’s displaying the correct file. Did you re-save the entries? Just updating the file won’t fix anything if the DB values are still incorrect.

#28

Aaron Jay

Feb 20, 2019

Hi Brian,

I think so, I re saved all the entries in both languages, but if check this link: http://blank.emagination.ie/ga

It’s showing the english version of the file, but it should be showing irish.pdf

#29

BoldMinded (Brian)

Feb 20, 2019

Did you click Update next to Publisher? Is the following hook in your exp_extensions table? after_channel_entry_update

#30

Aaron Jay

Feb 20, 2019

Hi Brian,

Yeah, I can see Publisher is showing as 2.10.8 in Add Ons.

Yeah, I can see that hook in the table.

#31

BoldMinded (Brian)

Feb 20, 2019

Make sure to turn off all caching. I noticed in your environment that you have caching enabled. I just tested again, with the environment you sent me, and everything is saving and displaying fine. It took so long to isolate the bug b/c I could see the DB getting updated correctly when saving, then before the save process finished, the wrong data was put back into the database fields, which is why the new hook is needed. I’m pretty certain this fixes the issue, regardless if it’s a simple text field or a file field 2 levels deep in a bloqs relationship.

#32

Aaron Jay

Feb 20, 2019

HI Brian,

There’s no third party caching plugins installed and I’ve gone to:

Settings: Content & Design > Cache dynamic channel queries and set that to off

Settings > Debugging & Output > Caching Driver > Disable Caching

Developer Utilities > Cache Manager an cleared all caches.

I also deleted all the entries and recreated them.

The issue is still there.  Is there anything I’m missing?

#33

BoldMinded (Brian)

Feb 20, 2019

I see what you’re saying when I look at your test site, but locally I’m not experiencing that. I looked at your database and all the values are correct for each entry and field value. I’m not sure what else to look at.

#34

Aaron Jay

Feb 20, 2019

Hi Brian,

Is there anything I can do to help you recreate this?  Could it a difference in the environment, PHP version or anything like that?

#35

BoldMinded (Brian)

Feb 20, 2019

I’d be surprised if PHP versions had anything to do with this, but my environment is running 7.1.

Have you tried it on a different server? And/Or, instead of just deleting those entries doing another fresh EE install, with default EE, Bloqs, and Publisher settings? Maybe start with uninstalling Bloqs and Publisher and re-installing before doing a whole new EE install. I don’t know if that will do anything, but if it fixes the behavior then we know what to take a closer look at.

#36

Aaron Jay

Feb 20, 2019

Hi Brian,

It is happening offline, on my local MAMP set up as well.

I tried uninstalling and reinstalling blocks and publisher and get the same result.

I’ve recreated the set up here: http://blank2.emagination.ie/

I used a fresh install of EE

I used the new version of publisher you sent on earlier

A fresh install of blocks

And I got the same result, the Irish version of the file will not display.

#37

BoldMinded (Brian)

Feb 20, 2019

In that new environment, delete everything in the exp_publisher_relationships table, then re-create the block in each entry (I deleted them already), and see if that makes a difference.

#38

Aaron Jay

Feb 21, 2019

Comment has been marked private.

#39

BoldMinded (Brian)

Feb 21, 2019

Ok, you may need to use an embed bc I think this might be a parsing issue. Try this:

{exp:channel:entries channel="pages" entry_id="3"}
  <h1>{title}</h1>
  {related_item}
    {related_publication_block}
        {embed="site/publication" entry_id="{related_publication:entry_ids}"}
    {/related_publication_block}
  {/related_item}
{/exp:channel:entries}

site/publication

{exp:channel:entries entry_id="{embed:entry_id}"}
    <h2>{title}</h2>
    {related_document}
        <h3>{related_document:title}</h3>
        file: {related_document:file}
    {/related_document}
{/exp:channel:entries}
#40

BoldMinded (Brian)

Feb 21, 2019

Comment has been marked private.

#41

Aaron Jay

Feb 22, 2019

Hi Brian,

That looks to have resolved it, thanks a million for all you help on this.

#42

BoldMinded (Brian)

Feb 22, 2019

Was it just the new Publisher version or the template changes, or both?

Login to reply

Contact

For add-on support, please use the Support section. General inquries and pre-sale questions can be sent to support@boldminded.com.