Does not affect views which do not run a count query. (e.g. dashlets)
Though, this is a quick win for all other views with which the user
interacts directly and gets the desired result quicker than before.
refs #3905
refs #3836
This reverts PR 6ea012af7e, reversing
changes made to be5b9f870b.
The reverted commit fixed a double query execution bug by only executing
the query once in either SimpleQuery::hasResult() or upon iteration.
But the fix (b20291a60) introduced two problems:
* Default sort rules no longer work
* Show more links missing
We work with DataView objects in our controllers and views. When
iterating over a DataView, it applies its default sort rules and then
returns the underlying query, see DataView::getIterator().
DataView::hasResult() on the other hand does not apply the default sort
rules. So, if hasResult() is called first, the default sort rules are no
longer applied because the query will be executed only once.
The fix would be as easy as to apply sorting in DataView::hasResult() as
well.
But now the show more part kicks in. We know whether there are more
results because we execute queries with $limit + 1. This is enabled via
SimpleQuery::peekAhead(). Unfortunately, we call
SimpleQuery::peekAhead() ALWAYS after SimpleQuery::hasResult(). And
that's why the show more links are missing because the query is executed
only once with the "wrong" limit.
For now, we just revert the commit in question and postpone a proper fix
for the double execution.
This is a dirty quick fix. And calling it *quick* is already an overstatement.
Of course, it's also a breaking change, as **all** non-english users need to
update their dashboard.ini after this change.
Oh, and don't dare to move this over to the new dashboards!
refs #3542
The former is the original name while title may
be changed by the user. This change is strictly
necessary for the references bug and should also
be introduced when rewriting this mess.
refs #3542