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: Relationship in Matrix field not saving for translations

Status Resolved
Add-on / Version Publisher 1.7.5
Severity
EE Version 2.9.2

Hop Studios

Dec 19, 2018

Hello Brian,

I know 1.7.5 is not supported but I need it to work on an EE2 version as the upgrade of the site is unexpectedly complicated.

The issue is as described in the title. The relationship field value is only saving for the default language (in this case English).
I saw that in here: https://boldminded.com/support/ticket/1790#comment36 you mentioned that some extensions are needed for this to happen. Does 1.7.5 have those extensions? or is there any way I can manually add them in?

#1

BoldMinded (Brian)

You said Matrix field in the title… did you mean Bloqs?

#2

BoldMinded (Brian)

If you meant Blocks, which I’m assuming you did b/c that is what the linked ticket you mentioned is about, then in Publisher’s libraries/EEBlocks folder is a Database/Adapter.php file which should replace the Adapter file in the Blocks codebase. EE2 version of Blocks wasn’t owned by me, and the best I could support it was with that modified Adapter file and the small hack mentioned in blocks-hack.md file.

#3

Hop Studios

Hello Brian,

Sorry for the confusion. Here is a more detailed description of what is happening:

  1. The site is using Publisher (1.7.5) and in EE2.9.2, we want to upgrade it to EE5
  2. The site was using matrix and playa, so I ran the playa matrix importer
  3. New fields were created and most of them kept the data
  4. The relationship fields in grid fields are not saving for translations other than the default language

Are there any extensions that I need to add in?

#4

Hop Studios

Hello Brian,

I want to also mention that.. I’ve tried this on a fresh EE2.11.9 install and the result is the same: relationships in grid columns are not saving for translations other than the default language. I can share with you the login information if you want to take a look. I am also on slack if you have any questions.

#5

BoldMinded (Brian)

Travis, I’m sorry you’re having trouble, but Publisher 1 support ended nearly 2 years ago (like 10 days shy of 2 years), and I don’t even have an EE2 environment running locally anymore to do a 5 minute “Yay/nay I can replicate this” check.

What sort of debugging have you done? Have you looked at the exp_publisher_relationships table to make sure there are no duplicate rows? If there are dupes or if something went wrong with the migration from Matrix to Grid? The query could be finding the incorrect rows, thus making it appear as if it’s only working in the default language.

#6

Hop Studios

Hello Brian,

I think the cause of my issue is that Publisher uses the col_id as the field_id when searching to see if the field (inside a grid column) is being ignored. After some manual db cleanup and adding !strpos($sql, ‘grid_col_id’) to the is_ignored condition, things appear to run as expected.

I will close this ticket now.

#7

BoldMinded (Brian)

Interesting that didn’t come up ages ago. Would you mind sharing your diff just in the random off chance this comes up again and someone stumbles upon this ticket?

#8

Hop Studios

In expressionengine/third_party/publisher/libraries/Publisher/hooks/Publisher_relationship_hooks.php

Replace line 115 with

if ( !strpos($sql, 'grid_col_id') && ee()->publisher_entry->is_ignored($entry_id, $field_id, ee()->publisher_lib->lang_id))

Replace line 235 with

if ( !strpos($sql, 'grid_col_id') && !$overrides && ee()->publisher_entry->is_ignored($entry_id, $field_id))

I haven’t tested this in EE3+ so I’m not sure if the modifications are still needed or if there’s a way to specifically ignore a relationship field inside a grid column.

#9

BoldMinded (Brian)

Thanks for sharing. I don’t plan to make updates to Publisher 1, but having this on record is good.

Login to reply