Bug #37362
incomplete url for results per page switch
| Status: | Closed | Start date: | 2012-05-21 | |
|---|---|---|---|---|
| Priority: | Should have | Due date: | ||
| Assignee: | Ingo Renner | % Done: | 100% |
|
| Category: | Frontend Plugins | |||
| Target version: | 2.8 | |||
| TYPO3 Version: | 4.5 | Has patch: | No | |
| PHP Version: | Tags: | |||
| Votes: | 0 |
Description
In tx_solr_pi_results_ResultsCommand::getResultsPerPageSwitch() the form action url is created using tslib_pibase::pi_linkTP_keepPIvars_url().
Strangely enough at this point $this->parentPlugin->piVars is empty (even though parentPlugin has tslib_pibase as the base class (in the end)).
The result is that the query is not included in the action url and only an empty page with search box is shown.
EAP: r.96106
Associated revisions
[BUGFIX] Incomplete url for results per page switch
Fixes: #37362
[BUGFIX] Incomplete url for results per page switch
Fixes: #37362
History
Updated by Ingo Renner 12 months ago
- Status changed from New to Accepted
- Target version set to 2.2
confirmed, I also stumbled over this one already
Updated by Ingo Renner 11 months ago
- Assignee set to Ingo Renner
- Priority changed from Should have to Must have
Updated by Ingo Renner 11 months ago
- Status changed from Accepted to Resolved
- % Done changed from 0 to 100
fixed in dkd-EAP r 98876
Updated by Ingo Renner 10 months ago
- Status changed from Resolved to Closed
Updated by Peter Niederlag 10 months ago
On current master it doesn't work for me as I do get "double" escaped params. Here is the action property of the form as seen in html source:
<form action="index.php?id=suche&amp;tx_solr%5Bq%5D=europa"
Inside of getQueryUrl() htmlspecialchars is applied on the returned result and inside getResultsPageSwitch() an additional htmlentities is applied on this result. Removing the later only cures part of the problem.
Updated by Ingo Renner 10 months ago
- Status changed from Closed to Under Review
- Priority changed from Must have to Should have
- Target version changed from 2.2 to 2.8
- % Done changed from 100 to 90
What confuses me is that you have the query in your form action URL. However, for what it's worth, getResultsPageSwitch() is gone in the next release. The results per page switch then is just a command like any other for pi_results.
Updated by Jonas Götze 7 months ago
In current Trunk EAP the query is completely missing (again?), when switching the resultsPerPage.
Is this "correct" for now or am I missing a configuration option for that?
Updated by Ingo Renner 7 months ago
- TYPO3 Version set to 4.5
- Has patch set to No
Agreed, that's a bug of course, will look into that...
Updated by Heiko Kromm 7 months ago
I can confirm this for 2.8.0-dev.
In addition to this, the send method for the switch in resources/templates/pi_results/results.htm is POST, which has to be GET.
Updated by Heiko Kromm 7 months ago
- File tx_solr_pi_results_resultsperpageswitchcommand.diff added
- File tx_solr_query_linkbuilder.diff added
I digged a little bit deeper into this, and changed some parts to get the results per page switch back to work.
I think sending the form does not work, if we put the search params in the form action, because some (perhaps all) browsers will remove the params in the action and only send the form fields while using send method GET.
Because of the missing piVars, I used the query_LinkBuilder to create my links. Unfortunatly the query_LinkBuilder removes unwanted url parameters and resultsPerPage is one of them. Therefore I had to add a method to this class to remove resultPerPage from the unwanted url parameters list.
At last I changed the onChange-Event in the SOLR_SEARCH_RESULTSPERPAGESWITCH section to refresh the window.location.href.
<!-- ###SOLR_SEARCH_RESULTSPERPAGESWITCH### beginn -->
<div class="tx-solr-search-result-resultsperpage">
<form action="###FORM.ACTION###" method="GET">
###LLL:results_per_page### <select onchange="if (this.value) window.location.href=this.value" name="###TX_SOLR.PREFIX###[resultsPerPage]">
<!-- ###LOOP:OPTIONS### begin -->
<!-- ###LOOP_CONTENT### -->
<option value="###OPTION.URL###" ###OPTION.SELECTED###>###OPTION.VALUE###</option>
<!-- ###LOOP_CONTENT### -->
<!-- ###LOOP:OPTIONS### end -->
</select>
</form>
</div>
<!-- ###SOLR_SEARCH_RESULTSPERPAGESWITCH### end -->
Updated by Ingo Renner 7 months ago
- Status changed from Under Review to Resolved
- % Done changed from 90 to 100
Updated by Ingo Renner 6 months ago
- Status changed from Resolved to Closed