The Joomla! Forum ™



Forum rules


Please use the official Bug Tracker to report a bug: http://joomlacode.org/gf/project/joomla ... er_id=8103



Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Fri Mar 16, 2012 6:46 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat Mar 01, 2008 6:41 pm
Posts: 10
I´ve noticed a weird problem in Joomla 2.5.1 backend. Whenever you filter results from the database - articles listing, redirect links listing, custom components listing - and you click to edit a record that´s not listed on page 1 (say 2 or 3) and then you return to the list view you´re redirected back to page 1 regardless the page the record you edited is.

How to make this problem happen:
1. Go to any list view.
2. Type anything in any of the filters so that the query returns more than one page of results.
3. Go to page 2.
4. Click to edit any record.
5. Click Close or Save and Close to get back to list view.
Voilà, you´re back to page 1 again.

This only happens if you´re using the filter.

Anyone knows how to fix this?

Claudio


Top
 Profile  
 
PostPosted: Wed Mar 28, 2012 1:52 pm 
Joomla! Fledgling
Joomla! Fledgling

Joined: Wed Mar 28, 2012 1:49 pm
Posts: 2
Hi, I have exactly the same problem.

Version 1.7.1 and Version 2.5.2


Top
 Profile  
 
PostPosted: Wed Mar 28, 2012 2:37 pm 
Joomla! Fledgling
Joomla! Fledgling

Joined: Wed Mar 28, 2012 1:49 pm
Posts: 2
I just found a temporary solution on V 1.7.1. I guess it will be similar for 2.5

file:
Code:
/libraries/joomla/application/component/modellist.php


Function (around line 345):
Code:
public function getUserStateFromRequest($key, $request, $default = null, $type = 'none', $resetPage = true)
   {
      $app = JFactory::getApplication();
      $old_state = $app->getUserState($key);
      $cur_state = (!is_null($old_state)) ? $old_state : $default;
      $new_state = JRequest::getVar($request, null, 'default', $type);

      if (($cur_state != $new_state) && ($resetPage)){
         JRequest::setVar('limitstart', 0);
      }

      // Save the new value only if it is set in this request.
      if ($new_state !== null) {
         $app->setUserState($key, $new_state);
      }
      else {
         $new_state = $cur_state;
      }

      return $new_state;
   }


Comment out :
Code:
      if (($cur_state != $new_state) && ($resetPage)){
         JRequest::setVar('limitstart', 0);
      }


The result code should be:
Code:
public function getUserStateFromRequest($key, $request, $default = null, $type = 'none', $resetPage = true)
   {
      $app = JFactory::getApplication();
      $old_state = $app->getUserState($key);
      $cur_state = (!is_null($old_state)) ? $old_state : $default;
      $new_state = JRequest::getVar($request, null, 'default', $type);

/*
This should be commented out
      if (($cur_state != $new_state) && ($resetPage)){
         JRequest::setVar('limitstart', 0);
      }
*/
      // Save the new value only if it is set in this request.
      if ($new_state !== null) {
         $app->setUserState($key, $new_state);
      }
      else {
         $new_state = $cur_state;
      }

      return $new_state;
   }


I have no idea if it will affect anything else at the moment, but it does what I need.


Top
 Profile  
 
PostPosted: Wed Dec 05, 2012 6:49 pm 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Fri Sep 02, 2005 2:26 am
Posts: 171
Location: Portugal
It seems that getUserStateFromRequest needs a new parameter in the end. You need to set resetPage to false.

Example:

$this->getUserStateFromRequest('com_xpto.filter.category_id', 'filter_category_id', 0, 'uint', false);

_________________
http://www.metpage.org | http://www.visigod.com


Top
 Profile  
 
PostPosted: Fri Jan 03, 2014 11:10 pm 
Joomla! Fledgling
Joomla! Fledgling

Joined: Tue Oct 27, 2009 5:27 pm
Posts: 4
This pagination issue is still not fixed in latest Joomla 2.5.17!:o


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 



Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group