[BUGFIX] SQL error if opening a disabled page with module
authorPhilipp Gampe <forge.typo3.org@philippgampe.info>
Wed, 5 Oct 2011 22:11:32 +0000 (00:11 +0200)
committerPhilipp Gampe <forge.typo3.org@philippgampe.info>
Wed, 5 Oct 2011 22:15:08 +0000 (00:15 +0200)
This happens because the list of page IDs is empty.
The count should be displayed regardless whether the current
page is hidden or not.

Change-Id: I73a2b7c1c2db7bee52d8350e6eda6b7eb59c9cb2
Fixes: #30585
Releases: 4.5, 4.6

typo3/sysext/linkvalidator/classes/class.tx_linkvalidator_processor.php
typo3/sysext/linkvalidator/modfuncreport/class.tx_linkvalidator_modfuncreport.php

index 07f830c..4b60177 100644 (file)
@@ -366,6 +366,11 @@ class tx_linkvalidator_Processor {
         */
        public function getLinkCounts($curPage) {
                $markerArray = array();
+
+               if (empty($this->pidList)) {
+                       $this->pidList = $curPage;
+               }
+
                if (($res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
                        'count(uid) as nbBrokenLinks,link_type',
                        'tx_linkvalidator_link',
index 9e7d54e..a8e9605 100644 (file)
@@ -450,9 +450,9 @@ class tx_linkvalidator_ModFuncReport extends t3lib_extobjbase {
                                $GLOBALS['BE_USER']->getPagePermsClause(1),
                                $this->modTS['checkhidden']
                        );
-                       if ($this->pObj->pageinfo['hidden'] == 0 || $this->modTS['checkhidden'] == 1) {
-                               $pageList .= $this->pObj->id;
-                       }
+
+                               // Always add the current page, because we are just displaying the results
+                       $pageList .= $this->pObj->id;
 
                        if (($res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
                                '*',