[BUGFIX] Define precedence of states in workspace module 67/30467/2
authorOliver Hader <oliver@typo3.org>
Wed, 28 May 2014 11:03:58 +0000 (13:03 +0200)
committerOliver Hader <oliver.hader@typo3.org>
Tue, 17 Jun 2014 13:00:37 +0000 (15:00 +0200)
The workspace module defines several states:
edited, moved, created, hidden, unhidden, deleted

The states "hidden" and "unhidden" are currently applied
after the action states. This change only uses the hidden
states if a record has been modified.

Resolves: #59118
Releases: 6.2
Change-Id: I95981306d61df38939a47579cb320dd93d51ce5b
Reviewed-on: https://review.typo3.org/30467
Reviewed-by: Wouter Wolters
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
typo3/sysext/workspaces/Classes/Service/GridDataService.php

index 3296664..69c1dfc 100644 (file)
@@ -506,12 +506,16 @@ class GridDataService {
         * @return string
         */
        protected function workspaceState($stateId, $hiddenOnline = FALSE, $hiddenOffline = FALSE) {
+               $hiddenState = NULL;
+               if ($hiddenOnline == 0 && $hiddenOffline == 1) {
+                       $hiddenState = 'hidden';
+               } elseif ($hiddenOnline == 1 && $hiddenOffline == 0) {
+                       $hiddenState = 'unhidden';
+               }
                switch ($stateId) {
                        case -1:
                                $state = 'new';
                                break;
-                       case 1:
-
                        case 2:
                                $state = 'deleted';
                                break;
@@ -519,12 +523,7 @@ class GridDataService {
                                $state = 'moved';
                                break;
                        default:
-                               $state = 'modified';
-               }
-               if ($hiddenOnline == 0 && $hiddenOffline == 1) {
-                       $state = 'hidden';
-               } elseif ($hiddenOnline == 1 && $hiddenOffline == 0) {
-                       $state = 'unhidden';
+                               $state = ($hiddenState ?: 'modified');
                }
                return $state;
        }