Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Pagination variables don't work #7

Closed
timkelty opened this Issue · 7 comments

2 participants

Tim Kelty Rob Sanchez
Tim Kelty

I think this probably broke with 2.4's changes to pagination.

$this->EE->uri->segment_array() doesn't have P# in it anymore. Not sure where we're supposed to get this now.

Rob Sanchez
Owner

Just wrote a patch in the develop branch. I think that'll fix it. Let me know.

Tim Kelty

Didn't work :(

Whats odd is, if I log $this->EE->uri->uri_string() from your ext, the pagination segments are NOT included (which is why it's not working). But, if I log the same from the template, the pagination segments ARE there.

Actual URI: /community/P1
$this->EE->uri->uri_string() logged from ext.mo_variables.php: community
$this->EE->uri->uri_string() logged from template: community/P1

Rob Sanchez
Owner

That's really weird, I'm var dumping inside the extension and am not missing the /P1. Do you have any other extensions on that mess with the uri? I'm thinking freebie, structure, there may be some others.

An alternative to uri_string() would be $_SERVER['PATH_INFO'], we can try that next.

Tim Kelty

Freebie was my first guess, but I'm not using it here. Structure could be it, let me test on my vanilla EE2 sandbox and see if I get what you are getting.

Tim Kelty

Ok, kind of have a handle on whats going on now...it's Pages/Structure related.

Here's what happens:

/template_group/template/P1 or /template_group/P1 : {paginated} works
/pages_uri/P1 (entry assigned to template_group/template): page not found (assuming strict_urls is on, 404)
/structure_uri/P1 (entry assigned to template_group/template): template is rendered, but {paginated} returns 0.

Tim Kelty

The same "problem" exists for anything using URI stuff in mo vars...like {current_url}. If it's a Structure page, the pagination segments are omitted.

Rob Sanchez
Owner

It sounds like structure is momentarily altering CI's uri_string. But I bet they don't futz with $_SERVER['PATH_INFO']. I just pushed a change to develop to use that instead. I think this might work. If so, then I can apply that change to all the methods which use the uri_string.

Rob Sanchez rsanchez closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.