[BUGFIX] List doesn't show all records
authorMichael Klapper <michael.klapper@aoemedia.de>
Wed, 6 Jul 2011 13:52:00 +0000 (15:52 +0200)
committerSusanne Moog <typo3@susannemoog.de>
Fri, 8 Jul 2011 17:09:16 +0000 (19:09 +0200)
The issue cannot be reproduced at the moment but
it is possible to run into such an issue some way.

The fix just solves the visible error but
does not fix the unknown initial problem.

Change-Id: I8569fb6585ed820177c5dffc1aa587b5fe42b427
Resolves: #26422
Release: 4.6, 4.5

typo3/sysext/workspaces/Classes/Service/GridData.php

index 9ea664e..cb4dd9b 100644 (file)
@@ -258,23 +258,27 @@ class tx_Workspaces_Service_GridData {
         * @return void
         */
        protected function sortDataArray() {
-               switch ($this->sort) {
-                       case 'uid';
-                       case 'change';
-                       case 'workspace_Tstamp';
-                       case 't3ver_oid';
-                       case 'liveid';
-                       case 'livepid':
-                               usort($this->dataArray, array($this, 'intSort'));
-                               break;
-                       case 'label_Workspace';
-                       case 'label_Live';
-                       case 'label_Stage';
-                       case 'workspace_Title';
-                       case 'path_Live':
-                                       // case 'path_Workspace': This is the first sorting attribute
-                               usort($this->dataArray, array($this, 'stringSort'));
-                               break;
+               if (is_array($this->dataArray)) {
+                       switch ($this->sort) {
+                               case 'uid';
+                               case 'change';
+                               case 'workspace_Tstamp';
+                               case 't3ver_oid';
+                               case 'liveid';
+                               case 'livepid':
+                                       usort($this->dataArray, array($this, 'intSort'));
+                                       break;
+                               case 'label_Workspace';
+                               case 'label_Live';
+                               case 'label_Stage';
+                               case 'workspace_Title';
+                               case 'path_Live':
+                                               // case 'path_Workspace': This is the first sorting attribute
+                                       usort($this->dataArray, array($this, 'stringSort'));
+                                       break;
+                       }
+               } else {
+                       t3lib_div::sysLog('Try to sort "' . $this->sort . '" in "tx_Workspaces_Service_GridData::sortDataArray" but $this->dataArray is empty! This might be the Bug #26422 which could not reproduced yet.', 3);
                }
        }