[BUGFIX] Remove editing restriction for elements in workspace-stages
authorTolleiv Nietsch <info@tolleiv.de>
Wed, 22 Jun 2011 12:38:29 +0000 (14:38 +0200)
committerAndreas Wolf <andreas.wolf@ikt-werk.de>
Fri, 8 Jul 2011 20:45:57 +0000 (22:45 +0200)
Fix bug where a (workspace) element which left the "editing" state can't be edited anymore if the editor doesn't have appropriate permission
for the current stage of the element. Now everyone can edit if they
are member within the workspace.

Change-Id: I172fe8e3f04fbc06ce1d33481032eaeae9532b6b
Resolves: #27643
Releases: 4.6, 4.5
Reviewed-on: http://review.typo3.org/2873
Reviewed-by: Michael Klapper
Tested-by: Michael Klapper
Reviewed-by: Stefan Neufeind
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
Reviewed-by: Susanne Moog
Reviewed-by: Andreas Wolf
Tested-by: Andreas Wolf
t3lib/class.t3lib_tcemain.php
t3lib/class.t3lib_userauthgroup.php

index d183063..5711f1e 100644 (file)
@@ -693,6 +693,7 @@ class t3lib_TCEmain {
                                                                        $newVersion_placeholderFieldArray[$GLOBALS['TCA'][$table]['ctrl']['tstamp']] = $GLOBALS['EXEC_TIME'];
                                                                }
                                                        }
+                                                               // Set stage to "Editing" to make sure we restart the workflow
                                                        if ($GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
                                                                $fieldArray['t3ver_stage'] = 0;
                                                        }
index ab60051..bf6fb92 100644 (file)
@@ -681,8 +681,9 @@ abstract class t3lib_userAuthGroup extends t3lib_userAuth {
                                                return 'Versioning disabled for table';
                                        } elseif ((int) $recData['t3ver_wsid'] !== $this->workspace) { // So does workspace match?
                                                return 'Workspace ID of record didn\'t match current workspace';
-                                       } else { // So what about the stage of the version, does that allow editing for this user?
-                                               return $this->workspaceCheckStageForCurrent($recData['t3ver_stage']) ? FALSE : 'Record stage "' . $recData['t3ver_stage'] . '" and users access level did not allow for editing';
+                                       } else {
+                                                       // So is the user allowed to "use" the edit stage within the workspace?
+                                               return $this->workspaceCheckStageForCurrent(0) ? FALSE : 'User\'s access level did not allow for editing';
                                        }
                                } else { // We are testing a "live" record:
                                        if ($res = $this->workspaceAllowLiveRecordsInPID($recData['pid'], $table)) { // For "Live" records, check that PID for table allows editing