Fixed bug #17355: Dependencies in sysext 'version' and 'workspaces'
authorOliver Hader <oliver.hader@typo3.org>
Thu, 17 Feb 2011 11:08:43 +0000 (11:08 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Thu, 17 Feb 2011 11:08:43 +0000 (11:08 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@10478 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_page.php
t3lib/class.t3lib_userauthgroup.php
typo3/alt_shortcut.php
typo3/sysext/belog/mod/index.php
typo3/sysext/beuser/mod/index.php
typo3/sysext/cms/tslib/class.tslib_fe.php
typo3/sysext/lowlevel/class.tx_lowlevel_cleaner_core.php

index f317f4e..7cfdbed 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-02-17  Oliver Hader  <oliver.hader@typo3.org>
+
+       * Fixed bug #17355: Dependencies in sysext 'version' and 'workspaces'
+
 2011-02-16  Jigal van Hemert  <jigal@xs4all.nl>
 
        * Cleanup #17606: Remove deprecated option TTFLocaleConv
index 0112678..4ba7ed0 100644 (file)
@@ -1414,7 +1414,7 @@ class t3lib_pageSelect {
         * @return      boolean <code>true</code> if has access
         */
        function checkWorkspaceAccess($wsid) {
-               if (!$GLOBALS['BE_USER']) {
+               if (!$GLOBALS['BE_USER'] || !t3lib_extMgm::isLoaded('workspaces')) {
                        return FALSE;
                }
                if (isset($this->workspaceCache[$wsid])) {
index 21a5cea..e620243 100644 (file)
@@ -876,7 +876,7 @@ class t3lib_userAuthGroup extends t3lib_userAuth {
                        return TRUE;
                }
 
-               if ($this->workspace > 0) {
+               if ($this->workspace > 0 && t3lib_extMgm::isLoaded('workspaces')) {
                        $stat = $this->checkWorkspaceCurrent();
 
                                // Check if custom staging is activated
@@ -1645,14 +1645,16 @@ class t3lib_userAuthGroup extends t3lib_userAuth {
                                        $wsRec = array('uid' => $wsRec);
                                break;
                                default:
-                                       $wsRec = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
-                                               $fields,
-                                               'sys_workspace',
-                                               'pid=0 AND uid=' . intval($wsRec) .
-                                               t3lib_BEfunc::deleteClause('sys_workspace'),
-                                               '',
-                                               'title'
-                                       );
+                                       if (t3lib_extMgm::isLoaded('workspaces')) {
+                                               $wsRec = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
+                                                       $fields,
+                                                       'sys_workspace',
+                                                       'pid=0 AND uid=' . intval($wsRec) .
+                                                       t3lib_BEfunc::deleteClause('sys_workspace'),
+                                                       '',
+                                                       'title'
+                                               );
+                                       }
                                break;
                        }
                }
@@ -1772,7 +1774,7 @@ class t3lib_userAuthGroup extends t3lib_userAuth {
                        return 0;
                } elseif ($this->checkWorkspace(-1)) { // Check offline
                        return -1;
-               } else { // Traverse custom workspaces:
+               } elseif (t3lib_extMgm::isLoaded('workspaces')) { // Traverse custom workspaces:
                        $workspaces = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid,title,adminusers,members,reviewers', 'sys_workspace', 'pid=0' . t3lib_BEfunc::deleteClause('sys_workspace'), '', 'title');
                        foreach ($workspaces as $rec) {
                                if ($this->checkWorkspace($rec)) {
index c925e8b..f7dff88 100644 (file)
@@ -736,11 +736,13 @@ class SC_alt_shortcut {
                }
 
                        // Add custom workspaces (selecting all, filtering by BE_USER check):
-               $workspaces = $TYPO3_DB->exec_SELECTgetRows('uid,title,adminusers,members,reviewers','sys_workspace','pid=0'.t3lib_BEfunc::deleteClause('sys_workspace'),'','title');
-               if (count($workspaces)) {
-                       foreach ($workspaces as $rec)   {
-                               if ($BE_USER->checkWorkspace($rec))     {
-                                       $options[$rec['uid']] = $rec['uid'].': '.$rec['title'];
+               if (t3lib_extMgm::isLoaded('workspaces')) {
+                       $workspaces = $TYPO3_DB->exec_SELECTgetRows('uid,title,adminusers,members,reviewers','sys_workspace','pid=0'.t3lib_BEfunc::deleteClause('sys_workspace'),'','title');
+                       if (count($workspaces)) {
+                               foreach ($workspaces as $rec)   {
+                                       if ($BE_USER->checkWorkspace($rec))     {
+                                               $options[$rec['uid']] = $rec['uid'].': '.$rec['title'];
+                                       }
                                }
                        }
                }
index d291c01..f1811fd 100755 (executable)
@@ -179,10 +179,12 @@ class SC_mod_tools_log_index {
                );
 
                // Add custom workspaces (selecting all, filtering by BE_USER check):
-               $workspaces = $TYPO3_DB->exec_SELECTgetRows('uid,title','sys_workspace','pid=0'.t3lib_BEfunc::deleteClause('sys_workspace'),'','title');
-               if (count($workspaces)) {
-                       foreach ($workspaces as $rec)   {
-                               $this->MOD_MENU['workspaces'][$rec['uid']] = $rec['uid'].': '.$rec['title'];
+               if (t3lib_extMgm::isLoaded('workspaces')) {
+                       $workspaces = $TYPO3_DB->exec_SELECTgetRows('uid,title','sys_workspace','pid=0'.t3lib_BEfunc::deleteClause('sys_workspace'),'','title');
+                       if (count($workspaces)) {
+                               foreach ($workspaces as $rec)   {
+                                       $this->MOD_MENU['workspaces'][$rec['uid']] = $rec['uid'].': '.$rec['title'];
+                               }
                        }
                }
 
index 78625dd..61f7594 100755 (executable)
@@ -1048,18 +1048,20 @@ class local_beUserAuth extends t3lib_beUserAuth {
                }
 
                        // Add custom workspaces (selecting all, filtering by BE_USER check):
-               $workspaces = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid,title,adminusers,members,reviewers,db_mountpoints','sys_workspace','pid=0'.t3lib_BEfunc::deleteClause('sys_workspace'),'','title');
-               if (count($workspaces)) {
-                       foreach ($workspaces as $rec)   {
-                               if ($this->checkWorkspace($rec))        {
-                                       $options[$rec['uid']] = $rec['uid'].': '.$rec['title'];
-
-                                               // Check if all mount points are accessible, otherwise show error:
-                                       if (trim($rec['db_mountpoints'])!=='')  {
-                                               $mountPoints = t3lib_div::intExplode(',',$this->workspaceRec['db_mountpoints'],1);
-                                               foreach ($mountPoints as $mpId) {
-                                                       if (!$this->isInWebMount($mpId,'1=1'))  {
-                                                               $options[$rec['uid']].= '<br> \- ' . $GLOBALS['LANG']->getLL('notAccessible', true) . ' ' . $mpId;
+               if (t3lib_extMgm::isLoaded('workspaces')) {
+                       $workspaces = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid,title,adminusers,members,reviewers,db_mountpoints','sys_workspace','pid=0'.t3lib_BEfunc::deleteClause('sys_workspace'),'','title');
+                       if (count($workspaces)) {
+                               foreach ($workspaces as $rec)   {
+                                       if ($this->checkWorkspace($rec))        {
+                                               $options[$rec['uid']] = $rec['uid'].': '.$rec['title'];
+
+                                                       // Check if all mount points are accessible, otherwise show error:
+                                               if (trim($rec['db_mountpoints'])!=='')  {
+                                                       $mountPoints = t3lib_div::intExplode(',',$this->workspaceRec['db_mountpoints'],1);
+                                                       foreach ($mountPoints as $mpId) {
+                                                               if (!$this->isInWebMount($mpId,'1=1'))  {
+                                                                       $options[$rec['uid']].= '<br> \- ' . $GLOBALS['LANG']->getLL('notAccessible', true) . ' ' . $mpId;
+                                                               }
                                                        }
                                                }
                                        }
index 6fc2a9a..4d85c1d 100644 (file)
@@ -4370,7 +4370,7 @@ if (version == "n3") {
                if ($returnTitle)       {
                        if ($ws===-1)   {
                                return 'Default Draft Workspace';
-                       } else {
+                       } elseif (t3lib_extMgm::isLoaded('workspaces')) {
                                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('title', 'sys_workspace', 'uid='.intval($ws));
                                if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                                        return $row['title'];
index b993539..7570b8a 100644 (file)
@@ -78,6 +78,8 @@ class tx_lowlevel_cleaner_core extends t3lib_cli {
 
        var $performanceStatistics = array();
 
+       protected $workspaceIndex = array();
+
 
        /**
         * Constructor
@@ -332,7 +334,9 @@ class tx_lowlevel_cleaner_core extends t3lib_cli {
                $pt = t3lib_div::milliseconds();$this->performanceStatistics['genTree()']='';
 
                        // Initialize:
-               $this->workspaceIndex = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid,title','sys_workspace','1=1'.t3lib_BEfunc::deleteClause('sys_workspace'),'','','','uid');
+               if (t3lib_extMgm::isLoaded('workspaces')) {
+                       $this->workspaceIndex = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid,title','sys_workspace','1=1'.t3lib_BEfunc::deleteClause('sys_workspace'),'','','','uid');
+               }
                $this->workspaceIndex[-1] = TRUE;
                $this->workspaceIndex[0] = TRUE;