- Reverting IRRE related changes in t3lib_BEfunc done for workspaces by Dmitry. They...
authorKasper Skårhøj <kasper@typo3.org>
Sun, 28 Oct 2007 12:43:12 +0000 (12:43 +0000)
committerKasper Skårhøj <kasper@typo3.org>
Sun, 28 Oct 2007 12:43:12 +0000 (12:43 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@2627 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_befunc.php

index 8eefc1c..713c8b9 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2007-10-28     Kasper Sk\8crh¿j  <kasperYYYY@typo3.com>
+       
+       * - Reverting IRRE related changes in t3lib_BEfunc done for workspaces by Dmitry. They were faulty.
 
 2007-10-28  Martin Kutschker  <martin.t.kutschker@blackbox.net>
 
index a010c9a..159e1d4 100755 (executable)
@@ -2841,25 +2841,13 @@ class t3lib_BEfunc      {
                $fTWHERE = str_replace('###PAGE_TSCONFIG_IDLIST###',$GLOBALS['TYPO3_DB']->cleanIntList($TSconfig[$field]['PAGE_TSCONFIG_IDLIST']),$fTWHERE);
                $fTWHERE = str_replace('###PAGE_TSCONFIG_STR###',$GLOBALS['TYPO3_DB']->quoteStr($TSconfig[$field]['PAGE_TSCONFIG_STR'], $foreign_table),$fTWHERE);
 
-               // Determine workspace ID. Rules:
-               //      - if table is not versioned, wsid is always 0
-               //      - otherwise if row is provided, use row's workspace
-               //      - otherwise use current user's workspace
-               // This is a typical algorithm used in TYPO3
-               $wsid = intval(
-                                       !$TCA[$foreign_table]['ctrl']['versioningWS'] ? 0 :
-                                               (isset($TSconfig['_THIS_ROW']) ? $TSconfig['_THIS_ROW']['t3ver_wsid'] :
-                                                       $GLOBALS['BE_USER']->workspace)
-                               );
-
                        // rootLevel = -1 is not handled 'properly' here - it goes as if it was rootLevel = 1 (that is pid=0)
                $wgolParts = $GLOBALS['TYPO3_DB']->splitGroupOrderLimit($fTWHERE);
                if ($rootLevel) {
-                       // No versioning for these records!
                        $queryParts = array(
                                'SELECT' => t3lib_BEfunc::getCommonSelectFields($foreign_table,$foreign_table.'.'),
                                'FROM' => $foreign_table,
-                               'WHERE' => $foreign_table.'.pid=0 ' .
+                               'WHERE' => $foreign_table.'.pid=0 '.
                                                        t3lib_BEfunc::deleteClause($foreign_table).' '.
                                                        $wgolParts['WHERE'],
                                'GROUPBY' => $wgolParts['GROUPBY'],
@@ -2869,58 +2857,29 @@ class t3lib_BEfunc      {
                } else {
                        $pageClause = $GLOBALS['BE_USER']->getPagePermsClause(1);
                        if ($foreign_table!='pages')    {
-                               if ($wsid == 0) {
-                                       $queryParts = array(
-                                               'SELECT' => t3lib_BEfunc::getCommonSelectFields($foreign_table,$foreign_table.'.'),
-                                               'FROM' => $foreign_table.',pages',
-                                               'WHERE' => 'pages.uid='.$foreign_table.'.pid' .
-                                                                       t3lib_BEfunc::deleteClause('pages').
-                                                                       t3lib_BEfunc::deleteClause($foreign_table).
-                                                                       ($pageClause != ' 1=1' ? ' AND ' . $pageClause : '') .
-                                                                       ' ' . $wgolParts['WHERE'],
-                                               'GROUPBY' => $wgolParts['GROUPBY'],
-                                               'ORDERBY' => $wgolParts['ORDERBY'],
-                                               'LIMIT' => $wgolParts['LIMIT']
-                                       );
-                               }
-                               else {
-                                       $queryParts = array(
-                                               'SELECT' => t3lib_BEfunc::getCommonSelectFields($foreign_table,$foreign_table.'.'),
-                                               'FROM' => $foreign_table,
-                                               'WHERE' => $foreign_table . '.pid=-1 AND ' .
-                                                                       $foreign_table . '.t3ver_wsid=' . $wsid .
-                                                                       t3lib_BEfunc::deleteClause($foreign_table).
-                                                                       $wgolParts['WHERE'],
-                                               'GROUPBY' => $wgolParts['GROUPBY'],
-                                               'ORDERBY' => $wgolParts['ORDERBY'],
-                                               'LIMIT' => $wgolParts['LIMIT']
-                                       );
-                               }
+                               $queryParts = array(
+                                       'SELECT' => t3lib_BEfunc::getCommonSelectFields($foreign_table,$foreign_table.'.'),
+                                       'FROM' => $foreign_table.',pages',
+                                       'WHERE' => 'pages.uid='.$foreign_table.'.pid
+                                                               AND pages.deleted=0 '.
+                                                               t3lib_BEfunc::deleteClause($foreign_table).
+                                                               ' AND '.$pageClause.' '.
+                                                               $wgolParts['WHERE'],
+                                       'GROUPBY' => $wgolParts['GROUPBY'],
+                                       'ORDERBY' => $wgolParts['ORDERBY'],
+                                       'LIMIT' => $wgolParts['LIMIT']
+                               );
                        } else {
-                               if ($wsid == 0) {
-                                       $queryParts = array(
-                                               'SELECT' => t3lib_BEfunc::getCommonSelectFields('pages', 'pages.'),
-                                               'FROM' => 'pages',
-                                               'WHERE' => $pageClause . t3lib_BEfunc::deleteClause('pages') . $wgolParts['WHERE'],
-                                               'GROUPBY' => $wgolParts['GROUPBY'],
-                                               'ORDERBY' => $wgolParts['ORDERBY'],
-                                               'LIMIT' => $wgolParts['LIMIT']
-                                       );
-                               }
-                               else {
-                                       $queryParts = array(
-                                               'SELECT' => t3lib_BEfunc::getCommonSelectFields('pages','pages.'),
-                                               'FROM' => 'pages pages, pages t2',
-                                               'WHERE' => $pageClause . t3lib_BEfunc::deleteClause('pages') .
-                                                                       t3lib_BEfunc::deleteClause('pages', 't2') .
-                                                                       ' AND pages.t3ver_wsid=' . $wsid .
-                                                                       ' AND pages.t3ver_oid=t2.uid AND pages.pid=-1' .
-                                                                       $wgolParts['WHERE'],
-                                               'GROUPBY' => $wgolParts['GROUPBY'],
-                                               'ORDERBY' => $wgolParts['ORDERBY'],
-                                               'LIMIT' => $wgolParts['LIMIT']
-                                       );
-                               }
+                               $queryParts = array(
+                                       'SELECT' => t3lib_BEfunc::getCommonSelectFields($foreign_table,$foreign_table.'.'),
+                                       'FROM' => 'pages',
+                                       'WHERE' => 'pages.deleted=0
+                                                               AND '.$pageClause.' '.
+                                                               $wgolParts['WHERE'],
+                                       'GROUPBY' => $wgolParts['GROUPBY'],
+                                       'ORDERBY' => $wgolParts['ORDERBY'],
+                                       'LIMIT' => $wgolParts['LIMIT']
+                               );
                        }
                }
 
@@ -3916,4 +3875,4 @@ class t3lib_BEfunc        {
                return array('rows'=>$theRows,'list'=>$out);
        }
 }
-?>
\ No newline at end of file
+?>