Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.5.1

Bug #13506 POST method deletes querystring
Submitted: 2008-03-26 13:21 UTC
From: creator Assigned: quipo
Status: Closed Package: Pager (version 2.4.5)
PHP Version: Irrelevant OS: Irrelevant
Roadmaps: (Not assigned)    
Subscription  


 [2008-03-26 13:21 UTC] creator (Stefano Coletta)
Description: ------------ When specifying 'httpMethod' => 'POST' for the Pager::factory method I've noticed that the generated HTML for the pager has all the actions set to the original URI but without the querystring. I can't use the 'httpMethod' => 'GET' because I need to leave the entire URI unmodified (I use it for session names). With the GET method I obtain the URI changed because PageID and perPage variables are added after the first submit. Right now I've roughly patched the Pager/Common.php file, function _renderLink() by changing the line 798: from $this->_generateFormOnClick($this->_url, $this->_linkData), to $this->_generateFormOnClick($_SERVER["REQUEST_URI"], $this->_linkData), Test script: --------------- If you use the Pager code in a page with an URL like: http://www.site.com/display.php?id=123 and you click on any button to go forward/backwards or any other page number in the pager, if the page uses the POST method you will be redirected to the same page WITHOUT the querystring. Expected result: ---------------- http://www.site.com/display.php?id=123 Actual result: -------------- http://www.site.com/display.php

Comments

 [2008-03-26 21:19 UTC] quipo (Lorenzo Alberton)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.