Bug #30559
Results don't listen to page browser when resultsPerPage is in URL
| Status: | Closed | Start date: | 2011-10-05 | |
|---|---|---|---|---|
| Priority: | Should have | Due date: | ||
| Assignee: | Ingo Renner | % Done: | 100% |
|
| Category: | Frontend Plugins | |||
| Target version: | 2.0 | |||
| TYPO3 Version: | Has patch: | |||
| PHP Version: | Tags: | |||
| Votes: | 0 |
Description
Tested with EAP version:
When tx_solr[resultsPerPage]=10 is part of the URL the page selected in the page browser (tx_solr[page]=5) is ignored; it will always show the first page of the results.
This only happens if resultsPerPage is set to 10 (maybe if it is the default value?); if a different value for resultsPerPage is used it will work correctly.
Associated revisions
Fixed issue #30559: Results don't listen to page browser when resultsPerPage is in URL, credits Jigal van Hemert
Fixed issue #30559: Results don't listen to page browser when resultsPerPage is in URL, credits Jigal van Hemert
History
Updated by Jigal van Hemert over 1 year ago
How to reproduce¶
Default is 10 results per page.
- Use switch to set results per page to a different value; search results reload with say 20 results
- Use switch to set results per page back to default value; search results reload with &tx_solr[resultsPerPage]=20 added to the URL. Now the paginator links include &tx_solr[resultsPerPage]=20
- Use switch to set results per page to different value; search results reload with &tx_solr[resultsPerPage]=10 added to the URL
Now the paginator links include &tx_solr[resultsPerPage]=10. The paginator itself works, but each time the first page of the search results is displayed.
The cause of the problem¶
In tx_solr_pi_results_ResultsCommand::getResultsPerPageSwitch() the action URL of the results per page switch includes the piVars. This includes the tx_solr[resultsPerPage].
However, every time this variable occurs in either POST or GET this is seen as a change in this setting; tx_solr[page] is now ignored (considered to be zero) and the first page result page is shown.
The paginator (extension pagebrowse) doesn't ignore tx_solr[page].
Solution¶
Unset the resultsPerPage and page piVars in the action URL:
$form = array(
'action' => $this->parentPlugin->pi_linkTP_keepPIvars_url(
array(
'resultsPerPage' => '',
'page' => '',
)
)
);
The whole concept of magically disappearing form variables is rather error prone. If a form is changed from post to get method these problems occur mainly because the pagebrowse extension doesn't support magically disappearing variables and will transport them to the next page.
Updated by Olivier Dobberkau over 1 year ago
- Status changed from New to Needs Feedback
- Assignee set to Ingo Renner
- Target version set to 2.5-dkd
Your take on this, Ingo?
Updated by Ingo Renner over 1 year ago
- Target version changed from 2.5-dkd to 2.0
Updated by Ingo Renner over 1 year ago
- Status changed from Needs Feedback to New
- Assignee deleted (
Ingo Renner)
Updated by Ingo Renner over 1 year ago
- Subject changed from Results doesn't listen to page browser when resultsPerPage is in URL to Results don't listen to page browser when resultsPerPage is in URL
Updated by Ingo Renner over 1 year ago
- Status changed from Accepted to Resolved
- Assignee set to Ingo Renner
- % Done changed from 0 to 100
fixed in dkd-EAP r 90942
Updated by Ingo Renner about 1 year ago
- Status changed from Resolved to Closed