• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

  • Chevereto Support CLST

    Support response

    Support checklist

    • Got a Something went wrong message? Read this guide and provide the actual error. Do not skip this.
    • Confirm that the server meets the System Requirements
    • Check for any available Hotfix - your issue could be already reported/fixed
    • Read documentation - It will be required to Debug and understand Errors for a faster support response

Classic pagination broken (missing sort key in query string) + possible reason and fix

InSiDiuS

Chevereto Member
▶🚶‍Reproduction steps
  1. In Classic Pagination: Go to image or album list and select one of the sort tabs other than "Most Recent"
  2. Click on the navigation arrows to go to the next page (assuming there are enough images/albums).
  3. Expected result: Goes to the next page in the order described
😢Unexpected result
  • The next page will re-highlight the "Most Recent" tab and the page navigation will give a wonky "Most Recent" sort order (sometimes giving blank pages)

📃Error log message
No errors noted.

After much investigation I narrowed it down to the fact that the "sort= " query string values were disappearing from the navigation links

E.g. the navigation link has the query string "?page=2&seek=J7y7Z" rather than the expected "?sort=date_asc&page=2&seek=J7y7Z".

I narrowed it down to this line in snippets/listing.php:

PHP:
   $QS = filter_input(INPUT_SERVER, 'QUERY_STRING', FILTER_SANITIZE_STRING);

which gives an unexpected $QS = null even though $_SERVER["QUERY_STRING"] is clearly populated.

After much googling, this is due to strange behaviour in filter_input when FASTCGI is used:

https://bugsdb.com/_en/debug/1bcbed448d666fedd8b4a16a9ef97fab

Anyways, the suggested fix is to replace filter_input with filter_input_fix (listed on page). When I used this in listing.php all the links show the correct query string and pagination is correctly restored.

[As an aside, this may also fix the issue where the "seek=" key shows up in the tab urls when endless pagination is used, but I have not tested this]
 
Thanks for bringing this to my attention, this is the second time I spot this situation and I will take care of patching this for the next revision.
 
Thanks for bringing this to my attention, this is the second time I spot this situation and I will take care of patching this for the next revision.
$QS = filter_input(INPUT_SERVER, 'QUERY_STRING', FILTER_SANITIZE_STRING);
Change SERVER with ENV if your server is in fastcgi php mode
OR TRY
to change SERVER with GET
In different servers INPUT_SERVER may be INPUT_ENV or INPUT_GET
 
$QS = filter_input(INPUT_SERVER, 'QUERY_STRING', FILTER_SANITIZE_STRING);
Change SERVER with ENV if your server is in fastcgi php mode
OR TRY
to change SERVER with GET
In different servers INPUT_SERVER may be INPUT_ENV or INPUT_GET
In my case the same problem is solved, when manually replace server with env.... after every update.... but let this is all
 
Does your variables_order ini directive includes the "E" for environment variables?
 
Back
Top