Fixed bug #9270: Editors can´t undelete records in history (thanks to Christian Hernm...
authorRupert Germann <rupi@gmx.li>
Thu, 17 Sep 2009 19:37:22 +0000 (19:37 +0000)
committerRupert Germann <rupi@gmx.li>
Thu, 17 Sep 2009 19:37:22 +0000 (19:37 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/branches/TYPO3_4-2@5961 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_tcemain.php
t3lib/class.t3lib_userauthgroup.php

index 9266871..ee58ea9 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-09-17  Rupert Germann  <rupi@gmx.li>
+
+       * Fixed bug #9270: Editors can´t undelete records in history (thanks to Christian Hernmarck)
+
 2009-09-15  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Fixed bug #11915: htmlArea RTE: superfluous span tags in content after server-based cleaning on paste operation
index dff05a3..cc6a91d 100755 (executable)
@@ -4001,11 +4001,11 @@ class t3lib_TCEmain     {
         * @param       boolean         If TRUE, the "deleted" flag is set to 0 again and thus, the item is undeleted.
         * @return      void
         */
-       function deleteRecord($table,$uid, $noRecordCheck=FALSE, $forceHardDelete=FALSE,$undeleteRecord=FALSE)  {
+       function deleteRecord($table,$uid, $noRecordCheck = FALSE, $forceHardDelete = FALSE, $undeleteRecord = FALSE) {
                global $TCA;
 
                        // Checking if there is anything else disallowing deleting the record by checking if editing is allowed
-               $mayEditAccess = $this->BE_USER->recordEditAccessInternals($table,$uid);
+               $mayEditAccess = $this->BE_USER->recordEditAccessInternals($table, $uid, FALSE, $undeleteRecord);
 
                $uid = intval($uid);
                if ($TCA[$table] && $uid)       {
index 3d32c57..cb218ec 100755 (executable)
@@ -548,9 +548,10 @@ class t3lib_userAuthGroup extends t3lib_userAuth {
         * @param       string          Table name
         * @param       mixed           If integer, then this is the ID of the record. If Array this just represents fields in the record.
         * @param       boolean         Set, if testing a new (non-existing) record array. Will disable certain checks that doesn't make much sense in that context.
+        * @param       boolean         Set, if testing a deleted record array.
         * @return      boolean         True if OK, otherwise false
         */
-       function recordEditAccessInternals($table,$idOrRow,$newRecord=FALSE)    {
+       function recordEditAccessInternals($table, $idOrRow, $newRecord = FALSE, $deletedRecord = FALSE) {
                global $TCA;
 
                if (isset($TCA[$table]))        {
@@ -561,7 +562,11 @@ class t3lib_userAuthGroup extends t3lib_userAuth {
 
                                // Fetching the record if the $idOrRow variable was not an array on input:
                        if (!is_array($idOrRow))        {
-                               $idOrRow = t3lib_BEfunc::getRecord($table, $idOrRow);
+                               if ($deletedRecord) {
+                                       $idOrRow = t3lib_BEfunc::getRecord($table, $idOrRow, '*', '', FALSE);
+                               } else {
+                                       $idOrRow = t3lib_BEfunc::getRecord($table, $idOrRow);
+                               }
                                if (!is_array($idOrRow))        {
                                        $this->errorMsg = 'ERROR: Record could not be fetched.';
                                        return FALSE;