Fixed bug #16005: Live workspace does not respect move-to-placeholders
authorBenni Mack <benni.mack@typo3.org>
Fri, 15 Oct 2010 21:34:27 +0000 (21:34 +0000)
committerBenni Mack <benni.mack@typo3.org>
Fri, 15 Oct 2010 21:34:27 +0000 (21:34 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/branches/TYPO3_4-4@9085 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_befunc.php

index 73a076d..a4597f4 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2010-10-15  Benjamin Mack  <benni@typo3.org>
 
+       * Fixed bug #16005: Live workspace does not respect move-to-placeholders
        * Fixed bug #11444: Workspace Dropdown in "Workspace" -> "Review and Publish" [LIVE workspace] always shows "[Draft Workspace]" (Thanks to Robert Heel)
 
 2010-10-15 Steffen Kamper  <steffen@typo3.org>
index 5923268..91c829b 100644 (file)
@@ -3970,13 +3970,23 @@ final class t3lib_BEfunc {
 
        /**
         * Will return where clause de-selecting new(/deleted)-versions from other workspaces.
+        * If in live-workspace, don't show MOVE-TO-PLACEHOLDERS if versioningWS is 2 (allows moving)
         *
         * @param       string          Table name
         * @return      string          Where clause if applicable.
         */
        public static function versioningPlaceholderClause($table) {
-               if ($GLOBALS['BE_USER']->workspace!==0 && $GLOBALS['TCA'][$table] && $GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
-                       return ' AND ('.$table.'.t3ver_state<=0 OR '.$table.'.t3ver_wsid='.intval($GLOBALS['BE_USER']->workspace).')';
+               if ($GLOBALS['TCA'][$table] && $GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
+                       $currentWorkspace = intval($GLOBALS['BE_USER']->workspace);
+                       if ($currentWorkspace !== 0) {
+                                       // show only the items of the current workspace
+                                       // if in any workspace other than live
+                               return ' AND (' . $table . '.t3ver_state <= 0 OR ' . $table . '.t3ver_wsid = ' . $currentWorkspace . ')';
+                       } elseif ($GLOBALS['TCA'][$table]['ctrl']['versioningWS'] == 2) {
+                                       // if in live workspace, don't show MOVE-TO-PLACEHOLDERS
+                                       // but only if if versioning of this table allows moving (versioningWS=2) 
+                               return ' AND (' . $table . '.t3ver_state != 3)';
+                       }
                }
        }