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_structure_hooks error when using exp:structure:nav with channel:title parameter

Status Resolved
Add-on / Version Publisher 3.1.5
Severity
EE Version 5.3.2

Hop Studios

Sep 28, 2020

Hello,

I have been working on an upgrade of a French/English site and we are migrating to Publisher for translations.

Structure is running on v4.6.1.

I encountered a possible bug when attempting to use previously working Structure Nav code as follows:

{exp:structure:nav exclude="5|119|120|159|172|173|279|283|332|335|336|48|875" channel:title="basic_page:title_fr" css_id="none" add_span="yes" current_class="active" show_depth="2" start_from="/" site_url="yes" show_depth="999"}

Error message:
Undefined index: title_fr
user/addons/publisher/legacy/libraries/hooks/Publisher_structure_hooks.php, line 362

The field being passed using the channel:title parameter worked totally fine pre-publisher on EE 2.11.9. Removing this parameter avoids the error message.

I did a bit of debugging through Publisher_structure_hooks.php, and when I was outputting the values of $translatedPages the previously used custom field ‘title_fr’ was not showing up in the array. There were a bunch of other data fields returned, but not that one. I poked around for a bit, but decided to submit a ticket and let you see if it is a bug on the publisher end or not.

The field is definitely in the exp_channel_data database field_id_11 and belongs to the aforementioned channel ‘basic_page’.

I would expect this to work as documented, but unfortunately it does not.

I have elected to migrate the contents of this field into new exp_publisher_titles entries for the translated titles. This is ultimately a better solution, but still, the structure tag should work!

Let me know if you have any insight into this and/or if you can replicate the issue.

I made a stripped down template to test this:
https://staging.nccdh.ca/admin/publisher_structure_test
https://staging.nccdh.ca/system/?/cp/design/template/edit/539
Access to FTP and EE CP are included.

To access the staging server you will need the htpasswd authentication [ admin / hophop ]

I look forward to hearing back from you.

Thanks,
Rowan
Hop Studios

#1

BoldMinded (Brian)

I’m guessing it has something to do with the fact that the field is prefixed with “title_” - have you tried changing the field name to see if it works? If it works when the field isn’t prefixed with “title_” it might provide a place to start when debugging this locally.

#2

Hop Studios

Hey Brian, Thanks for the reply. Sorry, doesn’t seem to work either. I tried ‘titlefr’ and even ‘ttlefr’ (in case it was looking for the whole ‘title’ word) but both create the same errors.

Thanks, Rowan

#3

BoldMinded (Brian)

Does it work with any other fields as the title field?

#4

Hop Studios

Hey Brian, No none of the other fields work either in the tag. As I mentioned, I have moved the title_fr values to the exp_publisher_titles table and this is working fine. I just think this might be a bug between publisher and structure. My work-around is the best way forward for me. Hopefully you can figure it out so others don’t encounter the same issue.

Thanks, Rowan

#5

BoldMinded (Brian)

Comment has been marked private.

#6

Hop Studios

Hey Brian, I have compared the Publisher_structure_hooks.php file you sent above with the version I have in 3.2.1 and they are identical. I presume you’ve worked this change into the core files! I did another quick test with the template I set up above, to see if it was working, and I noticed that when the ‘status’ is something like ‘status=”Footer Links”’ or ‘status=”Utility Navigation”’ or even ‘status=”not open”’ that the titles do not show up.

I hope this helps you debug the issue.

Thanks, Rowan Hop Studios

#7

BoldMinded (Brian)

I can replicate this too by adding status=”not open” to by {exp:structure:nav} tag, but after step debugging the Publisher hooks, it finds the translated titles correctly, and returns it to Structure, so I feel like Structure is doing something after Publisher to not display the titles… thus it seems like it’s a Structure issue? Can you replicate this in an environment without Publisher installed to see if it happens?

Login to reply