Odd values for prev and next page links

11 posts by 4 authors in: Forums > CMS Builder
Last Post: June 5, 2012   (RSS)

Re: [zip222] Odd values for prev and next page links

By Jason - January 17, 2011

Hi Zip,

If you could fill out a [url http://www.interactivetools.com/support/]2nd Level Support Request[/url] I can take a closer look into this.

In the comments of the request, be sure to indicate which .php file is experiencing the problem.

Thanks
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Odd values for prev and next page links

By Perchpole - June 2, 2012

Hello, All -

Did you ever resolve this issue? If so I wonder if it would help me with my issue? I'm also getting some weird results in my pagination links.

This is the showme output:

Array
(
[invalidPageNum] =>
[noRecordsFound] =>
[page] => 2
[perPage] => 12
[fromCache] => 0
[totalPages] => 2
[totalRecords] => 15
[pageResultsStart] => 13
[pageResultsEnd] => 15
[prevPage] => 1
[nextPage] =>
[prevPageLink] => /index.php?cat=6&gal=13&page=1
[nextPageLink] => /index.php?cat=6&gal=13&page=
[firstPageLink] => /index.php?cat=6&gal=13&page=1
[lastPageLink] => /index.php?cat=6&gal=13&page=2
[_detailPage] =>
[_listPage] => javascript:alert('Set List Page Url for this section in: Admin > Section Editors > Record > Viewer Urls')
)


The generated links are full of ampersands - which is having a serious knock on effect for some of my other page code.

What's causing this?

:0/

Perch

Re: [Perchpole] Odd values for prev and next page links

By Jason - June 4, 2012

Hi Perch,

The links are generated to have all the same data currently in the URL plus a "page" variable at the end. When outputted, all the & values should be evaluated as & (ie, index.php?cat=6&gal=13&page=1).

Are you experiencing something different? What effect is this having on the rest of your code?
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Odd values for prev and next page links

By Perchpole - June 4, 2012

Hi, Jason -

As you can see from the code above, the next/prev links contain multiple ampersands. This has the effect of breaking some of the code on the pages. The $_GET requests seem to fail, for example.

:0/

Perch

Re: [Perchpole] Odd values for prev and next page links

By Dave - June 5, 2012

Hi Perch,

Can you click on phpinfo under: Admin > General (at the bottom),
or just use this link: admin.php?menu=admin&action=phpinfo

And let me know what it says for: arg_separator.output

We're using a PHP function called http_build_query() to build urls that uses that value as a separator. My first guess is it has a different value than what is expected (which is &).

Let me know and I'll work on a fix for you. Thanks!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Odd values for prev and next page links

By Perchpole - June 5, 2012

Hi, Dave -

It reads:

arg_separator.input &
arg_separator.output &


:0)

Perch

Re: [Perchpole] Odd values for prev and next page links

By Dave - June 5, 2012

Hi Perch,

Try this fix with a recent CMSB version:

- Edit /cmsAdmin/lib/init.php
- Search for: zlib.output_compression
- Add the code in red below the zlib code:

// disable zlib.output_compression so we...
@ini_set('zlib.output_compression', 0);

// Set PHP arg_separator.output value to & so PHP http_build_query() function always works as expected
ini_set('arg_separator.output', '&');


Let me know if that works for you. Thanks!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Odd values for prev and next page links

By Perchpole - June 5, 2012

Hi, Dave -

That's perfect. Was my setting unusual?

:0S

Perch

Re: [Perchpole] Odd values for prev and next page links

By Dave - June 5, 2012

Hi Perch,

I can imagine why someone might have set it that way, but it wasn't one that we'd see yet. In any case, I've added that patch to the next release. We generally don't workaround PHP configuration issues until problems present themselves.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com