Fixed bug #14295: Recycler and tcemain->process_cmdmap cannot undelete some records...
authorSteffen Kamper <info@sk-typo3.de>
Wed, 5 May 2010 14:11:11 +0000 (14:11 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Wed, 5 May 2010 14:11:11 +0000 (14:11 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7537 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_tcemain.php

index 75af7e9..c6890b5 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2010-05-05  Steffen Kamper  <info@sk-typo3.de>
 
+       * Fixed bug #14295: Recycler and tcemain->process_cmdmap cannot undelete some records (thanks to Lars Houmark)
        * Fixed bug #14307: fe_user passwords are visible in the info popup window in the backend (thanks to Lars Houmark)
 
 2010-05-04 Francois Suter  <francois@typo3.org>
index c279481..e054967 100644 (file)
@@ -2762,7 +2762,7 @@ class t3lib_TCEmain       {
 */
                        if ($this->doesRecordExist($table,$uid,'show')) {               // This checks if the record can be selected which is all that a copy action requires.
                                $fullLanguageCheckNeeded = ($table != 'pages');
-                               if (($language > 0 && $this->BE_USER->checkLanguageAccess($language) ) || 
+                               if (($language > 0 && $this->BE_USER->checkLanguageAccess($language) ) ||
                                                $this->BE_USER->recordEditAccessInternals(
                                                        $table, $uid, false, false, $fullLanguageCheckNeeded
                                                )
@@ -4454,13 +4454,13 @@ class t3lib_TCEmain     {
         * @return      boolean         Whether the record can be undeleted
         */
        public function isRecordUndeletable($table, $uid) {
-               $result = false;
-               $record = t3lib_BEfunc::getRecord($table, $uid, 'pid', '', false);
+               $result = FALSE;
+               $record = t3lib_BEfunc::getRecord($table, $uid, 'pid', '', FALSE);
                if ($record['pid']) {
-                       $page = t3lib_BEfunc::getRecord('pages', $record['pid'], 'deleted, title, uid', '', false);
+                       $page = t3lib_BEfunc::getRecord('pages', $record['pid'], 'deleted, title, uid', '', FALSE);
                                // The page containing the record is not deleted, thus the record can be undeleted:
                        if (!$page['deleted']) {
-                               $result = true;
+                               $result = TRUE;
                                // The page containing the record is deleted and has to be undeleted first:
                        } else {
                                $this->log(
@@ -4469,6 +4469,9 @@ class t3lib_TCEmain       {
                                                $page['title'] . ' (UID: ' . $page['uid'] . ')" first'
                                );
                        }
+               } else {
+                               // The page containing the record is on rootlevel, so there is no parent record to check, and the record can be undeleted:
+                       $result = TRUE;
                }
                return $result;
        }