Fixed bug RFC #9797: Bug: waste of time in LIST module with LOISmode (thanks to Franz...
authorSteffen Kamper <info@sk-typo3.de>
Thu, 27 Nov 2008 19:45:20 +0000 (19:45 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Thu, 27 Nov 2008 19:45:20 +0000 (19:45 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@4492 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/class.db_list_extra.inc

index 05242b1..59023e9 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-11-27  Steffen Kamper  <info@sk-typo3.de>
+
+       * Fixed bug RFC #9797: Bug: waste of time in LIST module with LOISmode (thanks to Franz Holzinger)
+
 2008-11-27  Dmitry Dulepov  <dmitry.dulepov@gmail.com>
 
        * Fixed bug #8944: PHP-Error in class.em_index.php on line 4333 (thanks to Stefan Geith)
index f6813de..602bdfb 100755 (executable)
@@ -389,20 +389,23 @@ class localRecordList extends recordList {
                        // Init:
                $dbCount = 0;
                $out = '';
+               $LOISmode = $this->listOnlyInSingleTableMode && !$this->table;
 
                        // If the count query returned any number of records, we perform the real query, selecting records.
                if ($this->totalItems)  {
-                               // set the showLimit to the number of records when outputting as CSV
-                       if ($this->csvOutput) {
-                               $this->showLimit = $this->totalItems;
-                               $this->iLimit = $this->totalItems;
+                       if ($LOISmode)  {
+                               $dbCount = $this->totalItems;
+                       } else {
+                                       // set the showLimit to the number of records when outputting as CSV
+                               if ($this->csvOutput) {
+                                       $this->showLimit = $this->totalItems;
+                                       $this->iLimit = $this->totalItems;
+                               }
+                               $result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
+                               $dbCount = $GLOBALS['TYPO3_DB']->sql_num_rows($result);
                        }
-                       $result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
-                       $dbCount = $GLOBALS['TYPO3_DB']->sql_num_rows($result);
                }
 
-               $LOISmode = $this->listOnlyInSingleTableMode && !$this->table;
-
                        // If any records was selected, render the list:
                if ($dbCount)   {
 
@@ -1571,4 +1574,4 @@ if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/class
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/class.db_list_extra.inc']);
 }
 
-?>
\ No newline at end of file
+?>