[TYPO3-core] RFC: Bug #2666: Preview from searchresult shows rootpage only
Franz Holzinger
franz at fholzinger.com
Fri Mar 24 07:51:26 CET 2006
Michael Stucki a écrit :
>This is a CVS patch request.
>
>Problem:
>Searching (new feature) from the shortcutframe gives results in a list view.
>The preview you get when clicking the looking glass always returns rootpage.
>Previewing from the context sensitive help gives the correct page.
>
>Solution:
>Change $this->id after for each loop when in search mode.
>
>
>
>function renderListRow($table,$row,$cc,$titleCol,$thumbsCol,$indent=0) {
> $iOut = '';
>
>+ if (strlen($this->searchString)) { // If in search mode, make sure the preview will show the correct page
>+ $this->id = $row['pid'];
>+ }
>
I do not like this that a render function changes an internal member
variable without any warning and just because of another member
variable. Form the interface of this function you cannot see that it
changes the $this->id.
This can have side effects to other functions where $this->id is needed.
I suggest to introduce an additional $pid paramater to the functions
which are needed in this context.
- Franz
More information about the TYPO3-team-core
mailing list