EE compatibility updates:

  • Publisher is EE5 compatible, but it does not currently support the Fluid field.

ExpressionEngine.com licenses:

  • 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 Client Wait
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)

Sep 28, 2020

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

Sep 28, 2020

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)

Sep 28, 2020

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

#4

Hop Studios

Sep 28, 2020

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)

Sep 29, 2020

Comment has been marked private.

Login to reply

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