?
Referenced as Pull Request for: # 6548 Duplicate of: # 6570
avatar ribo72
ribo72
22 Mar 2015

Steps to reproduce the issue

Hello i saw this issue
In backend Article Manager:

  • Click Search tools
  • Use Select category and select a category with many articles in it
  • Use Page display to select a number of articles to display, other than "All"

Then page navigation buttons at bottom of page to not work.

I was disable cache in global configuration, in system plugin, i cleared browser's cache but this issue with pagination in backend exist.
The Template is isis - Default
This happened after update Joomla 3.4.0 to Joomla 3.4.1

Expected result

Actual result

System information (as much as possible)

Joomla 3.4.1
Database Version 5.6.23
PHP Version 5.4.38

Additional comments

Votes

# of Users Experiencing Issue
2/2
Average Importance Score
4.00

avatar ribo72 ribo72 - open - 22 Mar 2015
avatar ribo72 ribo72 - change - 22 Mar 2015
Labels Removed: ?
avatar ribo72 ribo72 - change - 22 Mar 2015
The description was changed
avatar ribo72 ribo72 - change - 22 Mar 2015
The description was changed
avatar ribo72 ribo72 - change - 22 Mar 2015
The description was changed
avatar n9iels
n9iels - comment - 22 Mar 2015

@test confirmed, page navigation doesn't work when search filters are used. Expect of the author filter

avatar dgt41
dgt41 - comment - 22 Mar 2015

Just a hint: #5994

avatar n9iels
n9iels - comment - 22 Mar 2015

and what kind of hint is it?

avatar dgt41
dgt41 - comment - 22 Mar 2015

With that PR some javascript was removed from many places. I think would be nice to test if restoring that code the problem vanish… I am in the middle of something right now and cannot test it myself, that’s the reason I tagged it as hint.

avatar n9iels
n9iels - comment - 22 Mar 2015

I will try if that work :+1:

avatar n9iels
n9iels - comment - 22 Mar 2015

nope, it doesn't solve this issue

avatar bertmert
bertmert - comment - 22 Mar 2015

I had similiar issue in a custom component some weeks ago. After some investigations I found out that under some circumstances

$this->getUserStateFromRequest

resets limitstart to 0.

See \libraries\legacy\model\list.php line 663

if (($cur_state != $new_state) && ($resetPage))
{
$input->set('limitstart', 0);
}

but
$app->getUserStateFromRequest(

does not reset to 0.

So, changing
\administrator\components\com_content\models\articles.php line 99

to

$categoryId = $app->getUserStateFromRequest($this->context . '.filter.category_id', 'filter_category_id');
$this->setState('filter.category_id', $categoryId);

seems to fix the issue.

Please don't ask for a PR because I haven't understood what happens there in list.php and why and if it should happen or not ;-)

avatar ribo72
ribo72 - comment - 22 Mar 2015

this change in \administrator\components\com_content\models\articles.php line 99 works


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6544.
avatar bertmert
bertmert - comment - 22 Mar 2015

But why did it work in J! <= 3.4.0 without $app ???

avatar dneukirchen
dneukirchen - comment - 22 Mar 2015

If you use the getUserStateFromRequest method from JApplication instead of the one in JModelList (changing $this->getUserStateFromRequest to $app->getUserStateFromRequest) you cant force the user back to the first page, when a filter has changed.

avatar bertmert
bertmert - comment - 22 Mar 2015

After some trial and error I replaced
/libraries/vendor/joomla/registry/src/Registry.php
with file from Joomla 3.4.0.
Pagination worked now.

Afterwards I replaced just
public function get($path, $default = null)
with method from Joomla 3.4.0.
Pagination worked.

88b9d4a#diff-f2d808f72f76a9bb5865ae501e659bd0R195

@mbabker Perhaps you can help?

avatar joomdonation
joomdonation - comment - 23 Mar 2015

I just had a quick look at the code and see that:

  1. It seems we can remove this block of code https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_content/models/articles.php#L87-L109 . It is not needed anymore as these states are set in the parent class already (in this block of code)

https://github.com/joomla/joomla-cms/blob/staging/libraries/legacy/model/list.php#L471-L477

Remove the block of code I mentioned seems fix the pagination issue.

  1. $app-> in this line https://github.com/joomla/joomla-cms/blob/staging/libraries/legacy/model/list.php#L471 should be replaced with $this-> so that when states change, you will be back to page 1

I might be wrong as I haven't looked at the code carefully enough. Will look at it again when I get home.

avatar joomdonation
joomdonation - comment - 23 Mar 2015

Seems this issue happens with page navigation on all other core components :(.

avatar sovainfo
sovainfo - comment - 23 Mar 2015

Yes, everywhere the search tool above the columns is used. Not with the filters in the left column.

avatar joomdonation
joomdonation - comment - 23 Mar 2015

Could anyone try the solution I proposed above to see whether it works?

avatar joomdonation
joomdonation - comment - 23 Mar 2015

OK. I made the PR #6548 to fix this issue. Please help testing it to get the issue fixed.

avatar phproberto
phproberto - comment - 23 Mar 2015

The real issue here is that an (object) casting was removed in Registry and then things are accessed differently. To be honest the real issue is that I used arrays to handle filters from searchtools and patched JRegistry to always cast data to (object) which after discussing it with @Hackwar I see it was wrong (See commit phproberto@ad9963b )

I tried to provide a fix on my branch https://github.com/phproberto/joomla-cms/commits/4467-categories which fixes the main issue because the casting is done in a custom getFilterStateFromRequest in JModelList instead of expecting Registry to do that for us (see phproberto@883b508#diff-0e0b8a6a2b081b6dbb1c0e7d27ae4f1aR700 )

I think that's a better fix than #6548 but for sure harder to test with third part extension using search tools now.

avatar brianteeman brianteeman - change - 23 Mar 2015
Labels Added: ?
avatar wilsonge
wilsonge - comment - 24 Mar 2015

@phproberto the (object) casting was removed from Registry in 3.3

avatar bertmert
bertmert - comment - 25 Mar 2015

$app-> in this line https://github.com/joomla/joomla-cms/blob/staging/libraries/legacy/model/list.php#L471 should be replaced with $this-> so that when states change, you will be back to page 1

Just to mention it from my point of view (who cares ;-) ): I have never understood why view returns to page 1 when I change filter settings. With your PR 6548 it works correctly I think. When I'm on the last page (let's say 17) and see 5 items with filter "Published" (Display # = 5) and change state of these items to "Unpuplished" the view changes correctly to page 16 (new last page). Also correct handling with pages in the middle.

avatar bertmert
bertmert - comment - 25 Mar 2015

the (object) casting was removed from Registry in 3.3

What does this mean for dump testers like me. Patch of phproberto is not an alternative for this issue?

avatar joomdonation
joomdonation - comment - 25 Mar 2015

@bertmert When you change the states (filters), the total records returned will be changed. I thought that when you are on page 17, and with the state/fiter changes, the system can only found 5 records for example (which match the filter).

If the page is not reset to first page, no records will be displayed which is wrong. However, somehow, Joomla still handle this case properly (I haven't had time to look at it yet). So please ignore that comment from me (I didn't make that change in the PR, too).

avatar phproberto
phproberto - comment - 6 Apr 2015

Please test #6677

avatar syhussaini
syhussaini - comment - 9 Apr 2015

I am facing issue only with the page breaks inside an article in front end UI. No issues were recorded in Read More or Page navigation under article lists. This all started after updating to Joomla 3.4.1

When selecting a different page using the page breaks, the article will simply go blank.

PHP Version 5.4.28
Web Server Apache
WebServer to PHP Interface cgi-fcgi
Joomla! Version Joomla! 3.4.1 Stable [ Ember ] 21-March-2015 20:30 GMT
Joomla! Platform Version Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT

Please help.

Regards
Syed H


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6544.
avatar zero-24
zero-24 - comment - 9 Apr 2015

@syhussaini can you open a new issue at http://issues.joomla.org/tracker/joomla-cms as this here is for issues in the backend together with the searchtools

avatar fgossart
fgossart - comment - 16 Apr 2015

I can confirm immediatly the same issue.
When enabling filtering in articles view it always stays on the first selection when clic on 2.. 3.. in pagination tabs


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

avatar Bakual
Bakual - comment - 18 Jun 2015

My attempt at fixing it: #7194

avatar smz
smz - comment - 27 Jun 2015

This should probably be closed as we have #7194 merged

avatar zero-24 zero-24 - change - 27 Jun 2015
Status New Closed
Closed_Date 0000-00-00 00:00:00 2015-06-27 08:22:13
Closed_By zero-24
Build master staging
avatar zero-24 zero-24 - close - 27 Jun 2015

Add a Comment

Login with GitHub to post a comment