[TYPO3-core] RFC: Bug #2666: Preview from searchresult shows rootpage only

Michael Stucki michael at typo3.org
Fri Mar 24 11:43:16 CET 2006


Hey Franz,

> >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.

I don't expect that it will have any additional side-effects since this mode 
is very special anyway ($this->id would be empty normally).

What I can/will do is to set it back to 0 again once the loop is finished.

- michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20060324/7c8a40f5/attachment.pgp 


More information about the TYPO3-team-core mailing list