Project

General

Profile

Actions

Bug #21986

closed

When using tx_indexedsearch together with macina_searchbox the paging wasn't working properly

Added by Michael almost 15 years ago. Updated about 11 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Indexed Search
Target version:
-
Start date:
2010-01-18
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.3
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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 &lt;!MV!&gt;
'document.'.$this->prefixId.'[\''.$this->prefixId.'[_sections]\'].value=\''.$arguments['_sections'].'\';'.// new &lt;!MV!&gt;
'document.'.$this->prefixId.'[\''.$this->prefixId.'[_freeIndexUid]\'].value=\''.rawurlencode($freeIndexUid).'\';'.
'document.'.$this->prefixId.'.submit();return false;';
return '&lt;a href=&quot;#&quot; onclick=&quot;&#039;.htmlspecialchars($onclick).&#039;&quot;&gt;'.$str.'&lt;/a&gt;';
}

and a additional TS-Config:

search.exactCount = 1

(issue imported from #M13287)

Actions

Also available in: Atom PDF