?
avatar Hackwar
Hackwar
8 Dec 2014

If you have a component in the frontend that uses JModelList and calls the parent populateState method, the pagination will be overwritten by session data. That means that you can not move back to page 1 of a list of items. This should be changed so that it works identical in both front- and backend. Most likely it would be best to do this in the new MVC classes...

avatar Hackwar Hackwar - open - 8 Dec 2014
avatar jissues-bot jissues-bot - change - 8 Dec 2014
Labels Added: ?
avatar Bakual
Bakual - comment - 8 Dec 2014

Sounds like #4488, or not?

avatar Hackwar
Hackwar - comment - 8 Dec 2014

Nope. The issue is, that I send a GET request in the frontend with no start parameter in the pagination set for the first page. (Compared to a POST in the backend) That means that it will still retrieve the data from the session and that will be non-zero as long as some other page has been visited. We don't have that issue in our core extensions in the frontend, because we don't call JModelList::populateState().

avatar Bakual
Bakual - comment - 8 Dec 2014

I know, but it is broken in 3.3.6 and reverted in staging. In staging and before 3.3.6 this works fine.

avatar brianteeman
brianteeman - comment - 1 Jan 2015

Is this still an open issue then?


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5350.
avatar brianteeman brianteeman - change - 1 Jan 2015
Status New Information Required
avatar Hackwar
Hackwar - comment - 1 Jan 2015

This is indeed still an issue. While in the backend, you can do a parent::populateState() and have most stuff taken care of, this will break your component in the frontend and for example prevent pagination from working.

avatar brianteeman
brianteeman - comment - 13 Jan 2015

Resetting to open


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5350.
avatar brianteeman brianteeman - change - 13 Jan 2015
Status Information Required Confirmed
avatar bcordis
bcordis - comment - 16 Jan 2015

Is anyone fixing this?


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5350.
avatar Hackwar
Hackwar - comment - 16 Jan 2015

I doubt that someone is working on this right now. It is not easy to solve, when I looked into it.

avatar itsam
itsam - comment - 16 Feb 2015

I don't know if related but try to set e.g. limit = 2; directly to frontend populateState and see that nothing actually happens. The same goes for any other filter as well (e.g. catid). On the other hand, at backend everything works as expected. Please verify that problem indeed exists.

avatar Hackwar
Hackwar - comment - 16 Feb 2015

The issue is, that the backend expects a form to be submitted via POST with the values when moving through the pagination, while the frontend uses GET URLs instead. This is not easily solvable currently. The best bet would be to fix this with new MVC classes.

avatar itsam
itsam - comment - 16 Feb 2015

How do you explain the following:
$limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->getCfg('list_limit'));
$limit = 2;
$this->setState('list.limit', $limit);

I would expect to get only 2 items but that's not the case...
It's like parent::populateState overrides everything else...

Sorry if I miss the forest here but I am really confused

avatar Bakual
Bakual - comment - 16 Feb 2015

One difference between front- and backend is that the backend uses the session (UserState) to store the current value. That means if you don't pass a limit, the value from the session is used.

It's like parent::populateState overrides everything else...

Yes, parent::populateState will set the limits again, overriding your value. See https://github.com/joomla/joomla-cms/blob/staging/libraries/legacy/model/list.php#L551

If you need to adjust them different in your extension, you need to do it after that call.

avatar bcordis
bcordis - comment - 16 Feb 2015

So is this a bug or we just need to abandon in are code the use of the set state?

avatar Bakual
Bakual - comment - 16 Feb 2015

It's not a bug that parent::populateState does set the limit. It's part of the job of that method.

You can set your own limits after you have called the parent method, or you just don't call it in your own method.

avatar roland-d
roland-d - comment - 12 Dec 2015

Hello @Hackwar

Thank you for your contribution.

The last comment here was on February 17th. So the question is, Is this issue/pull request still valid?
If no reply is received within 4 weeks we will close this issue.

Thanks for understanding!


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5350.

avatar brianteeman brianteeman - change - 12 Dec 2015
Status Confirmed Information Required
avatar brianteeman brianteeman - change - 16 Jan 2016
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2016-01-16 10:53:21
Closed_By brianteeman
avatar brianteeman
brianteeman - comment - 16 Jan 2016

closed as per the last comment


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5350.

avatar brianteeman brianteeman - close - 16 Jan 2016

Add a Comment

Login with GitHub to post a comment