[TYPO3-core] RFC: Bug 4631: pi_list_browseresults shows "Next" link when there are no results

Dmitry Dulepov dmitry at typo3.org
Tue Jan 23 09:59:38 CET 2007


Hi!

Michael Stucki wrote:
> Problem:
> See subject.
> 
> Solution:
> Check if there are results, otherwise skip the result browser.
> 
> Bugtracker reference:
> http://bugs.typo3.org/view.php?id=4631
> 
> Branches:
> TYPO3_4-0 & Trunk

I do not really understand the logic. Let's assume that $pointer is 0 
and $totalPages is 0. Then

if (0 < -1 || $showFirstLast)	{
if (0 == -1 || 1)	{	// Link to next page

So it makes "next" link visible if $showFirstLast is true and 
$totalPages is 0 (= no pages). What is the logic here? Should second 
condition instead be:

if ($pointer==$totalPages-1 && $totalPages) { // Link to next page

> Index: typo3/sysext/cms/tslib/class.tslib_pibase.php
> ===================================================================
> --- typo3/sysext/cms/tslib/class.tslib_pibase.php	(Revision 1855)
> +++ typo3/sysext/cms/tslib/class.tslib_pibase.php	(Arbeitskopie)
> @@ -545,7 +545,7 @@
>  				}
>  			}
>  			if ($pointer<$totalPages-1 || $showFirstLast)	{
> -				if ($pointer==$totalPages-1) { // Link to next page
> +				if ($pointer==$totalPages-1 || !$totalPages)	{	// Link to next page
>  					$links[]=$this->cObj->wrap($this->pi_getLL('pi_list_browseresults_next','Next >',$hscText),$wrapper['disabledLinkWrap']);
>  				} else {
>  					$links[]=$this->cObj->wrap($this->pi_linkTP_keepPIvars($this->pi_getLL('pi_list_browseresults_next','Next >',$hscText),array($pointerName => $pointer+1),$pi_isOnlyFields),$wrapper['inactiveLinkWrap']);


-- 
Dmitry Dulepov

Web: http://typo3bloke.net/
Skype: callto:liels_bugs

"It is our choices, that show what we truly are,
far more than our abilities." (A.P.W.B.D.)


More information about the TYPO3-team-core mailing list