php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25159 getPerPageSelectBox doesn't works
Submitted: 2003-08-19 16:57 UTC Modified: 2003-09-10 10:01 UTC
From: maka3d at yahoo dot com dot br Assigned: quipo (profile)
Status: Closed Package: PEAR related
PHP Version: 4.3.2 OS: WINXP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
34 + 4 = ?
Subscribe to this entry?

 
 [2003-08-19 16:57 UTC] maka3d at yahoo dot com dot br
Description:
------------
The getPerPageSelectBox method of Pager_Sliding Class doesn't memorize the _perPage inside a session

Reproduce code:
---------------
function _setOptions($options){
	session_start(); // should have a session_start to be able to read and write the $_SESSION array
	global $_GET, $_REQUEST, $_SESSION; // and should take off this line or put it before session_start()
cause it rewrite the $_SESSION array created before with session_start()

	...
	
	session_write_close() // and add a session_write_close() at the end of the method


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-08-20 04:01 UTC] nicos@php.net
Index: Sliding.php
===================================================================
RCS file: /repository/pear/Pager_Sliding/Sliding.php,v
retrieving revision 1.15
diff -u -u -r1.15 Sliding.php
--- Sliding.php 15 Jul 2003 22:25:33 -0000      1.15
+++ Sliding.php 20 Aug 2003 08:58:26 -0000
@@ -895,7 +895,7 @@
         }

         //prevent URL manual modification
-        $this->_currentPage = min($this->_currentPage, $this->_totalPages);
+        $this->_currentPage = min($this->_currentPage, $this->_totalPages);
     }


@@ -930,8 +930,6 @@
      */
     function _getLinksUrl()
     {
-        global $_SERVER;
-
         // Sort out query string to prevent messy urls
         $querystring = array();
         $qs = array();
@@ -985,8 +983,6 @@
      */
     function _setOptions($options)
     {
-        global $_GET, $_REQUEST, $_SESSION;
-
         $allowed_options = array(
             'totalItems',
             'perPage',
@@ -1079,4 +1075,4 @@

     // }}}
 }
-?>
\ No newline at end of file
+?>


Btw I wonder if Lorenzo Alberton knows that if (!empty($_SESSION["$this->_sessionVar"])) is just stupid, it should be if (!empty($_SESSION[$this->_sessionVar]))... Everywhere.
 [2003-08-20 13:18 UTC] maka3d at yahoo dot com dot br
what about a solution for getPerPageSelectBox?
 [2003-09-01 09:31 UTC] quipo@php.net
I've just come back home. I'll have a look ASAP.
 [2003-09-01 17:10 UTC] quipo@php.net
please check CVS version. The _perPage var should be stored in the session now.
 [2003-09-02 07:23 UTC] maka3d at yahoo dot com dot br
Very Thanks, I'll try it now.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 14:01:29 2024 UTC