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: core_template_route hook breaks Structure pagination

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

Timothy Kelty

Jun 03, 2013

Structure has a hook for core_template_route that allows pagination segments to work.

It appears Publisher’s hook is overriding this, breaking pagination on sites with Structure.

#1

BoldMinded (Brian)

Just adding the note from your email about this. I’ll look into it tonight, sorry for the delay (had a busy weekend).

In ext.structure, in the core_template_route method, I changed the $uri_string to a reference (&$uri_string) and then added $uri_string = $new_uri_string; after $new_uri_string was defined. Not sure if that’s the right approach or not, seems like a change might have to happen in Structure, though.
#2

Timothy Kelty

No prob - I posted this because I found that fix doesn’t really work. I thought it was, so it might in some cases.

It seems like the right approach might be to check for last call data in your core_template_route, so you will get the group/template from structure, and then from there go ahead with your stuff.

#3

BoldMinded (Brian)

What happens if you change the Publisher->core_template_route in the extensions table to have the priority of 10 instead of 11?

#4

Timothy Kelty

No change if I set it to 10.

For the time being (since I’m not using URL translations and persistent entries is on), at the top of Publisher->core_template_route, I’m just returning the last call, since Structure returns the template we want:

// Fusionary hack
     // Temporary pagination fix
     if (ee()->extensions->last_call !== FALSE)
     {
         return ee()->extensions->last_call;
     }
#5

BoldMinded (Brian)

I might have to implement some P segment slashing then.

#6

Timothy Kelty

Instead of duplicating what Structure is doing, could you check for last call, and if its an array, then you know it’s coming from structure or another ext, and then you can do your url_translation/persistent entries stuff?

Might not work, just a thought.

#7

BoldMinded (Brian)

Tim, move that to the bottom of core_template_route instead so its the last thing run. Basically Publisher doesn’t need to find the template b/c Structure will find it for us (Publisher updates the site_pages array prior to Structure doing its lookups). If it gets to the bottom of that method without returning anything else, then Structure will handle it as usual.

#8

Timothy Kelty

Ah, good point!

Login to reply