[BUGFIX] Correct dependency handling in workspaces module 58/38858/4
authorDominique Kreemers <dominique.kreemers@arrabiata.de>
Wed, 22 Apr 2015 13:42:19 +0000 (15:42 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Sat, 6 Jun 2015 13:08:51 +0000 (15:08 +0200)
This patch fixes a bug where records, which have references
pointing to them, are in a table that is disabled for
workspaces throw an element not found RuntimeException.

Without this change, you will get an error in the workspace module
for tables that are not workspace-enabled, but have file references
pointing to them.

Change-Id: I16c42f0347e0c1c6d916e24f865eb2af643929da
Resolves: #66523
Releases: master, 6.2
Reviewed-on: http://review.typo3.org/38858
Reviewed-by: Frank N├Ągler <typo3@naegler.net>
Reviewed-by: Alexander Opitz <opitz.alexander@googlemail.com>
Tested-by: Alexander Opitz <opitz.alexander@googlemail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>

index b9caff5..3adfc7c 100644 (file)
@@ -164,6 +164,11 @@ class ElementEntityProcessor {
         * @return void
        public function createNewDependentElementCallback(array $callerArguments, array $targetArgument, ElementEntity $caller, $eventName) {
+               if (!BackendUtility::isTableWorkspaceEnabled($caller->getTable())) {
+                       $caller->setInvalid(TRUE);
+                       return;
+               }
                $versionRecord = $caller->getRecord();
                // If version record does not exist, it probably has been deleted (cleared from workspace), this means,
                // that the reference index still has an old reference pointer, which is "fine" for deleted parents