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: navEE Extension 1.2 Issues with Publisher 1.0.3

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

Mike C

Jul 23, 2013

Hi Brian -

I’ve run into two issue with the navEE extension, as follows:

Adding a manual link for a non-default language in navEE seems to be mucking up the URL when saving. For example, if I enter this into my second language and click Update:

http://www.google.com

navEE saves it as this:

http__navEE__3a2f2fwww__navEE__2egoogle__navEE__2ecom

I have tried this on a few different nodes with different URLs in navEE and the behaviour is consistent (see screen).

However, this does not happen if I try something like: [removed]void(0)

That is saved fine.

——

The second issue is that the extension does not seem to apply the same handling of language prefixes and label names when building navEE custom crumbs (they all use the default language values). I have posted at navEE support about this but have not gotten a response from them so I’m not certain if addressing this would be on their end or yours? I would have hoped that crumbs would work like normal navs. Is that possible?

Thanks for all the help,
Mike

#1

Mike C

I have found what looks like a further bug in regards to entering manual URLs in navEE with Publisher. The URL being entered in the CP does not show up on the front end.

On this page: http://staging.cadex.com/en/applications/hospitals

I had the ‘Manual’ link URL set to http://www.yahoo.com in the CP and that value shows up in the DB (with the corresponding mucked up non-primary language URL in the exp_publisher_navee_labels table.

However, on the front end was link is not being used (it was: http://staging.cadex.com/en).

I have cleared all caches and that makes no difference.

I then turned Publisher Off and that link remained. I then edited the navEE link to www.google.com. The correct URL showed up in the DB but now the front end link is http://staging.cadex.com/en/applications/hospitals. You can try any page on that site to see for yourself.

I have also tried this with navEE’s ‘clear cache on submit’ set to true and false.

And lastly, even though Publisher is Off, all my navEE nav still has the language prefix added to it (en).

#2

Mike C

Ok - further issues. I’m including them here though I don’t know that’a they’re related to the items above.

See this page: http://staging.cadex.com

And notice in the columns, the duplicate links (sets of two). These are drawn from Matrix rows from 3 Matrix fields (one for each column) in the channel entry. There should only be one link each (no duplicates). Publisher is currently Off. When I turn it On, those duplicates disappear from the channel entry on the edit page and front end. If I turn Publisher back Off, the duplicates show up again.

Please let me know if you’d like CP access. At this point, I am not willing to do any further work as I seem to be running into a number of issues.

I should note: We are running Matrix 2.4.3 - I tried upgrading to the latest Matrix earlier when I was installing Publisher and it caused some PHP errors so I reverted to the previously installed version.

#3

BoldMinded (Brian)

Mike, I’m going to send a new build. I encountered the double Matrix rows on a site myself yesterday and fixed it.

#4

Mike C

Great - thanks Brian. Is there anything in that build re: the navEE issues - or is that something else to look at?

#5

BoldMinded (Brian)

I’m looking into the NavEE stuff right now.

#6

BoldMinded (Brian)

Grab this file again, I made some changes that should fix the navEE issues.

https://github.com/litzinger/publisher_navee/blob/master/third_party/publisher_navee/ext.publisher_navee.php

#7

Mike C

Still seeing some issues…

Note: I just updated the various files - I did not re-install. I’m hoping to avoid that at this point if possible as a fair amount of work has been put in place already.

Fixed

  • Adding a manual URL to a non-primary language is now saving correctly

Still Not Working

  • The ‘Manual’ link still not working. After editing it to check the non-primary language URL input, I was getting PHP notices (see below). So I removed that link and added a new ‘manual’ link with a URL of www.yahoo.com but that still is not showing up with the correct link on the front end (see staging.cadex.com - top right link). However, the PHP notices disappeared.
  • The double matrix rows are still appearing when Publisher is Off (see staging.cadex.com)
  • The navEE custom crumbs still do not work as per custom navs as per my original post. I don’t think this was addressed but I wanted to note it - would love (and expect) those to work like navs.
A PHP Error was encountered

Severity: Notice

Message: Undefined property: Publisher_lib::$lang_code

Filename: models/publisher_site_pages.php

Line Number: 933

A PHP Error was encountered

Severity: Notice

Message: Undefined property: Publisher_lib::$lang_code

Filename: models/publisher_site_pages.php

Line Number: 933

A PHP Error was encountered

Severity: Notice

Message: Undefined property: Publisher_lib::$lang_code

Filename: models/publisher_site_pages.php

Line Number: 933

A PHP Error was encountered

Severity: Notice

Message: Undefined property: Publisher_lib::$lang_code

Filename: models/publisher_site_pages.php

Line Number: 933

A PHP Error was encountered

Severity: Notice

Message: Undefined property: Publisher_lib::$lang_code

Filename: models/publisher_site_pages.php

Line Number: 933

A PHP Error was encountered

Severity: Notice

Message: Undefined property: Publisher_lib::$lang_code

Filename: models/publisher_site_pages.php

Line Number: 933

A PHP Error was encountered

Severity: Notice

Message: Undefined property: Publisher_lib::$lang_code

Filename: models/publisher_site_pages.php

Line Number: 933

A PHP Error was encountered

Severity: Notice

Message: Undefined property: Publisher_lib::$lang_code

Filename: models/publisher_site_pages.php

Line Number: 933

A PHP Error was encountered

Severity: Notice

Message: Undefined property: Publisher_lib::$lang_code

Filename: models/publisher_site_pages.php

Line Number: 933

A PHP Error was encountered

Severity: Notice

Message: Undefined property: Publisher_lib::$lang_code

Filename: models/publisher_site_pages.php

Line Number: 933

A PHP Error was encountered

Severity: Notice

Message: Undefined property: Publisher_lib::$lang_code

Filename: models/publisher_site_pages.php

Line Number: 933

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: core/Common.php

Line Number: 408


Fatal error: ob_start() [<a href="http://ref.outcontrol">ref.outcontrol</a>]: Cannot use output buffering in output buffering display handlers in /nfs/c07/h04/mnt/112936/domains/system252_stag/codeigniter/system/core/Exceptions.php on line 166
#8

BoldMinded (Brian)

“The double matrix rows are still appearing when Publisher is Off (see staging.cadex.com)” - Yeah, this will happen if Publisher is disabled. There are duplicate rows in the Matrix table, so Matrix is pulling them.

Go to exp_extensions and find the Publisher hooks for matrix_data_query and matrix_display_field and make sure the disabled column is set to “y” - This might fix it, but I haven’t tested.

I’ll look into the NavEE issues later tonight. Those PHP notices are very weird b/c its kind of impossible for that variable not to be set. Are you saying those errors are thrown when Publisher is enabled or disabled?

#9

Mike C

–“Yeah, this will happen if Publisher is disabled. There are duplicate rows in the Matrix table, so Matrix is pulling them.”

Ok - so just trying to make certain I understand this. In an earlier post, you said you ran into that issue and fixed it but it is still happening for me on that one page. Do you mean to say then this won’t happen in the future but for Matrix fields previous to this last update, that will still happen because those rows are in the table already? Or is this just always the case if Pub is Off (in which case, I’m just curious what was fixed)?

–“Those PHP notices are very weird b/c its kind of impossible for that variable not to be set. Are you saying those errors are thrown when Publisher is enabled or disabled?”

No, those last PHP notices I posted weren’t related to Pub On or Off. They showed up when I made an edit to one of the navEE links to test out the fix regarding mangling the manual URL. So, I just deleted that navEE node and they disappeared - I haven’t seen them since.

–“I’ll look into the NavEE issues later tonight.”

Ok - thanks. The URLs not showing correctly on the front end is odd. They’re correct in the CP and DB. And getting the custom crumbs working would be awesome.

Thanks, Mike

#10

BoldMinded (Brian)

The Matrix fix is retroactive, but if Publisher is off it will still display multiple rows b/c there are extra rows in the matrix table and Publisher isn’t given a chance to filter them. If changing the enabled column on those two hooks to “y” works, then I can fix this going forward fairly easily. I just need that confirmation from you (I’ll test this later too myself).

#11

BoldMinded (Brian)

Sent another build, it disabled Publisher, but keeps Matrix, Playa, and Assets hooks active

#12

Mike C

Latest build fixes the ‘manual’ link issue - URLs are displaying correctly on the front end.

Updating those settings in exp_extensions does fix the double Matrix issue.

  • Still hoping for crumbs support - not pestering, just keeping things documented as this progresses. =) A further note on this if you are looking at the navEE extension further, I noticed that the navEE variable ‘is_selected’ does not parse to ‘true’ when a non-primary language is loaded. I posted about this on navEE just incase it lies in their domain. ‘is_selected’ is used to ascertain if the current node is active - and I guess it’s failing due to the injection of the language prefix?

  • Also, just a minor item you may want to be aware of (it’s a non-issue for me): If Pub is turned off and a user had a cookie established for a non-primary language, that language’s labels will still load for navEE (ie. the user will see the primary language content but the nav will be in the language set in the exp_publisher_site_language cookie

Thanks again, Mike

#13

BoldMinded (Brian)

Mike, I send another build. You’ll also need to modify NavEE per the instructions in this Gist https://gist.github.com/litzinger/6076121 and grab the latest https://github.com/litzinger/publisher_navee/blob/master/third_party/publisher_navee/ext.publisher_navee.php

Hopefully The Outfit will add those changes to the official release so you don’t have to worry about patching it again.

#14

Mike C

Hi Brian -

I have updated everything and here’s what’s happening:

Fixed

  • ‘is_selected’ seems to be working now for other languages

Still Not Working

Custom crumbs seem to not be working still for other languages. See this page for an example: http://staging.cadex.com/de/applications/professional-mobile-radio

FYI, my navEE code in the template is:

{exp:navee:custom_crumbs wrap_type="ul" class="breadcrumb" ignore_include_in_nav="true"}
   {if count == 1}<li class="home"><a href="http://{site_url}">Home</a></li>{/if}
   <li{if is_last_item} class="last"{/if}>{if is_last_item == ""}<a href="http://{link}">{/if}{text}{if is_last_item == ""}</a>{/if}</li>
{/exp:navee:custom_crumbs}

Existing/New Issues

This is something that still is not working but I’m seeing new PHP notices. There are two links (Partner Login and Manual2) on the English (default language) homepage (http://staging.cadex.com/en) whose URLs are wrong. They both show http://staging.cadex.com/en on the front end but have different manual URLs in the DB ([removed]void(0); and http://www.google.com, respectively).

I tried deleting the Partner Login node from navEE which produced these PHP notices on the English only (none when pulling up DE):

A PHP Error was encountered

Severity: Notice

Message: Undefined offset: 0

Filename: helpers/Publisher_helper_url.php

Line Number: 625

A PHP Error was encountered

Severity: Notice

Message: Undefined offset: 0

Filename: helpers/Publisher_helper_url.php

Line Number: 625

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: core/Common.php

Line Number: 408


Fatal error: ob_start() [<a href="http://ref.outcontrol">ref.outcontrol</a>]: Cannot use output buffering in output buffering display handlers in /nfs/c07/h04/mnt/112936/domains/system252_stag/codeigniter/system/core/Exceptions.php on line 166

I then added that navEE node back onto the nav and saved it and now these PHP notices come up for EN only:

A PHP Error was encountered

Severity: Notice

Message: Undefined offset: 0

Filename: helpers/Publisher_helper_url.php

Line Number: 625

A PHP Error was encountered

Severity: Notice

Message: Undefined offset: 0

Filename: helpers/Publisher_helper_url.php

Line Number: 625

A PHP Error was encountered

Severity: Notice

Message: Undefined offset: 0

Filename: helpers/Publisher_helper_url.php

Line Number: 625

A PHP Error was encountered

Severity: Notice

Message: Undefined offset: 0

Filename: helpers/Publisher_helper_url.php

Line Number: 625

A PHP Error was encountered

Severity: Notice

Message: Undefined offset: 0

Filename: helpers/Publisher_helper_url.php

Line Number: 625

A PHP Error was encountered

Severity: Notice

Message: Undefined offset: 0

Filename: helpers/Publisher_helper_url.php

Line Number: 625

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: core/Common.php

Line Number: 408


Fatal error: ob_start() [<a href="http://ref.outcontrol">ref.outcontrol</a>]: Cannot use output buffering in output buffering display handlers in /nfs/c07/h04/mnt/112936/domains/system252_stag/codeigniter/system/core/Exceptions.php on line 166

Thanks, Mike

#15

BoldMinded (Brian)

I fixed that last error just earlier today. On line 625 of Publisher_helper_url.php, change it to this:

if (isset($segs[0]) && substr($segs[0], 0, 4) != ‘http’)

#16

BoldMinded (Brian)

As for the crumbs, you made all the changes to NavEE that I noted, and updated the Publisher NavEE extension file?

Michael made the additions this morning, so they’ll be official soon.

#17

Mike C

I’ve updated that one line - PHP notices are gone.

The ‘Partner Login’ and ‘Manual2’ links still show the wrong ULR on the EN version of the site though. I tried radding another new link (Test) to go to foo.com and it does the same thing - wrong URL.

Re: crumbs. I double-checked and yes, I think everything has been updated correctly. I guess I could wait for the navEE update if Michael is pushing that through soon if you think everything should be working? I pushed the latest Pub build you sent, the 1.4 extension build and swapped in those 4 updated functions.

#18

Mike C

Hi Brain -

I’m waiting on a navEE build from Michael to test the crumbs. I’m not certain fi that will address the issues in regards to the ‘Manual2’ and ‘Test’ links?

Further, in the meantime, another bug which I assume is related to 1.0.3 and the MSM updates. I currently have added…

{exp:publisher:switcher}
 

 {exp:publisher:languages}
     {short_name}
     {long_name}
     {id}
     {is_default}
     {is_enabled}
     {is_active}
     {direction}
     {switch_language_url}
     {translated_url}
 {/exp:publisher:languages}

…in the mast area of the site (staging.cadex.com/en) and the switcher is only spitting out a select pair (no options) and the languages tag pair does not see to parse anything inside of it.

Thanks, Mike

#19

Mike C

Hi Brian -

Michael sent me the new navEE build this AM but that has not addressed any of the current issues. As it stands, I’m seeing the following items:

Crumbs still default to the primary language (example: http://staging.cadex.com/de/applications/professional-mobile-radio). The crumb should pick up the DE labels past ‘Home’ as: Home>Anwendungen>DE Professional Mobile Radio

The Manual2 and Test links (or any added manual URL link to vavEE) still exhibit this odd behaviour of showing the incorrect URL on the primary language version. The URL is correct on non-primary languages and if I turn Pub off they’re also ok.

As noted above, those ex:publisher tags don’t seem to be parsing correctly.

Thanks, Mike

#20

BoldMinded (Brian)

Mike, would it be possible to get FTP access to this site so I can debug it quicker? If so edit the ticket and add the info to the provided fields.

#21

Mike C

FTP Added. Please be aware this account currently has PROD and STAG installs on it.

All work from this ticket is happening in:

/staging.batteryuniversity.com (primary MSM domain) /staging.cadex.com (site where the multi-language work is taking place) /system252_stag (system install for these staging directories)

Please do not edit anything in other directories.

Let me know if you need anything else.

Thanks, Mike

#22

BoldMinded (Brian)

Mike, I’m going to need CP access too, sorry. Are you sure you entered label translations in the NavEE module?

#23

BoldMinded (Brian)

I did fix the language selector through.

#24

Mike C

Credentials added Brian. And yes, there are label translations in for the relevant pages in my examples for the crumbs - but not every page. I would assume those same labels (which show up in the main navEE custom nav should show up in the navEE custom crumbs.

Thanks, Mike

#25

BoldMinded (Brian)

I was able to fix the crumbs but it required adding nav_title=”navPrimMajor” to the tag, otherwise it doesn’t know which navigation_id to look for. I also made this change to the NavEE codebase, which if I’m reading it right will make sure $this->navigation_id is always set, thus you don’t need to set the nav_title parameter. https://gist.github.com/litzinger/6112395

#26

Mike C

Thanks Brian - I really appreciate you staying on top of these. I think that only leaves the issue of adding manual links to navEE. I’ll continue staying out of there while you look at that so we don’t overwrite each other or cause unexpected behaviour.

#27

BoldMinded (Brian)

I haven’t been back into your environment, but using navee:crumbs and navee:custom_crumbs with manual links and the change I posted in the gist above, the links render properly.

#28

Mike C

Thanks but I’m not referring to the crumbs now for the last issue. It is in regards to adding links to navEE with manual URLs - those seem to be seriously bugged.

Go to this page: http://staging.cadex.com/en

Look at the URLs in the masthead for: ‘Manual2’ and ‘Test’ (the URLs being written out are wrong - those are not the ones in the DB and navEE module UI)

Now go to: http://staging.cadex.com/de and look at those same links. They now have the correct URLs written out (yahoo.com and foo.com).

Further, if I turn Pub off the correct URLs appear.

I’ve tried deleting and creating new navEE nodes and the same behaviour happens.

Does that make sense?

#29

BoldMinded (Brian)

Yeah, I’ll login to your CP after I get some dinner and take a look. I thought we were still talking about the breadcrumbs, thanks for clearing that up 😊

#30

Mike C

Not a problem - and don’t rush dinner. =)

#31

BoldMinded (Brian)

Fixed! It was an issue with the publisher_navee extension which I pushed to GitHub.

#32

Mike C

Awesome - thanks Brian. It appears everything is working. Here’s hoping we don’t bump into anything else! =)

Thanks again, Mike

#33

Mike C

Ahem… maybe I spoke to soon - or perhaps I’m dong something wrong but I think not. Maybe another bug related to the MSM settings. I have this code:

<ul>
  <li class="current">{exp:publisher:languages show_current="yes"}{long_name}{/exp:publisher:languages}</li>
  {exp:publisher:languages show_current="no"}
  <li><a href="http://{switch_language_url}">{long_name}</a></li>
  {/exp:publisher:languages}
 </ul>

And it seems the show_current parameter when set to ‘yes’ loops through ALL languages - not just the current one. See the output on this page: http://staging.cadex.com/en

#34

BoldMinded (Brian)

Can you check your Phrases > Languages group to see if there are any duplicate phrases?

#35

Mike C

No duplicates - just {phrase:language_en} and {phrase:language_de}

Note: that group can only be viewed from the site ID 1 CP view - it does not show up when viewing in site ID 2 (not certain if that’s relevant).

#36

BoldMinded (Brian)

Mike, after reading this again and looking at the site I think you’re misunderstanding what the show_current parameter does. “yes” is the default value, meaning it will show all languages. When set to now, it just removes the currently selected language from the list. So setting it to “no” when using 2 languages, like in your case, it basically creates a toggle between the two languages.

#37

Mike C

Thanks - understood and sorry for the confusion.

#38

BoldMinded (Brian)

No worries. I should probably document that better.

#39

Mike C

Hi Brian -

Sorry but another error with the latest 1.0.3 build you sent. It’s not specific to navEE but I kept it in this thread as you have credentials available from here and it seems likely it’s related to 1.0.3.

When going to access Publisher > Categories in the CP, the following error is thrown:

A PHP Error was encountered

Severity: Notice

Message: Undefined property: Addons_modules::$pubilsher_category

Filename: publisher/mcp.publisher.php

Line Number: 802


Fatal error: Call to a member function get_first_group() on a non-object in /nfs/c07/h04/mnt/112936/domains/system252_stag/expressionengine/third_party/publisher/mcp.publisher.php on line 802

Thanks, Mike

#40

BoldMinded (Brian)

No worries. Its an easy fix. If you look at the error you’ll see publisher is spelled wrong 😊

Just go to line 802 of that file and fix the spelling and you should be set.

#41

Mike C

Thanks - fixed.

Login to reply