?
avatar itsam
itsam
3 Apr 2015

Steps to reproduce the issue

At any component /models/bars <-- bars is the plural of model bar (could be articles or whatever)

Unset some (or all for example's sake) items at public function getItems()

for ($x = 0, $count = count($items); $x < $count; $x++)
{
    unset($items[$x]);
}

Expected result

I would expect the pagination to contain no pages

Actual result

Depending on the number of items before unset varies from 1 to N pages

System information (as much as possible)

Joomla 3.4.1
definitely occurs on previous versions as well

Additional comments

I suspect that JModelList "calculates" pagination taking into account only the getListQuery and not the getItems() of the model

Is this normal?

avatar itsam itsam - open - 3 Apr 2015
avatar itsam itsam - change - 3 Apr 2015
Labels Removed: ?
avatar zero-24 zero-24 - change - 3 Apr 2015
Labels Added: ?
avatar laoneo
laoneo - comment - 5 Oct 2015

Because of performance reasons it tries to return only the count of the records as seen here https://github.com/joomla/joomla-cms/blob/staging/libraries/legacy/model/legacy.php#L326 in a second db call. If that is not possible it does a second query, getting all the items. So this behavior is expected.


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

avatar brianteeman brianteeman - change - 28 Jan 2016
Status New Expected Behaviour
Closed_Date 0000-00-00 00:00:00 2016-01-28 13:14:04
Closed_By brianteeman
avatar brianteeman
brianteeman - comment - 28 Jan 2016

Closing as expected behaviour based on the comment above


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

avatar brianteeman brianteeman - close - 28 Jan 2016

Add a Comment

Login with GitHub to post a comment