Bug #21986
closedWhen using tx_indexedsearch together with macina_searchbox the paging wasn't working properly
0%
Description
Hello,
we experienced that all search results were displayed on the first search result page but after pressing "Page 2" the results were displayed from result 11 to the end of all search results (for example search result 234) and so on. So the limit didn't seem to work.
We could solve the problem but we needed to change the core in
typo3/sysext/indexed_search/pi/class.tx_indexedsearch.php
in line 614 from:
// All rows for display is put into resultRows[]
if ($c > $pointer * $this->piVars['results'] ) {
to:
// All rows for display is put into resultRows[]
if ($c > $pointer * $this->piVars['results'] && $c <= ($pointer+1) * $this->piVars['results']) {
Have we done something wrong for example missed out some configuration? Or is it bug and will you change this too?
I have to mention that we've needed to do more changes before:
The macina search template needed the form name "tx_indexedsearch" and the hidden field "tx_indexedsearch[_freeIndexUid]"
as well as a Core-Patch:
- typo3/sysext/indexed_search/pi/class.tx_indexedsearch.php
(added the freeIndexUid)
/**
* Used to make the link for the result-browser.
* Notice how the links must resubmit the form after setting the new pointer-value in a hidden formfield.
*
* @param string String to wrap in <a> tag
* @param integer Pointer value
* @param string List of integers pointing to free indexing configurations to search.
* -1 represents no filtering, 0 represents TYPO3 pages only, any number above zero is a
* uid of an indexing configuration!
* @return string Input string wrapped in <a> tag with onclick event attribute set.
*/
function makePointerSelector_link($str,$p,$freeIndexUid) {
$arguments = t3lib_div::_GP($this->prefixId); // new <!MV!>
$onclick = 'document.'.$this->prefixId.'[\''.$this->prefixId.'[pointer]\'].value=\''.$p.'\';'.
'document.'.$this->prefixId.'[\''.$this->prefixId.'[sword]\'].value=\''.$arguments['sword'].'\';'.// new <!MV!>
'document.'.$this->prefixId.'[\''.$this->prefixId.'[_sections]\'].value=\''.$arguments['_sections'].'\';'.// new <!MV!>
'document.'.$this->prefixId.'[\''.$this->prefixId.'[_freeIndexUid]\'].value=\''.rawurlencode($freeIndexUid).'\';'.
'document.'.$this->prefixId.'.submit();return false;';
return '<a href="#" onclick="'.htmlspecialchars($onclick).'">'.$str.'</a>';
}
and a additional TS-Config:
search.exactCount = 1
(issue imported from #M13287)