Skip to content

Commit

Permalink
[BUGFIX] Skip error when processing already deleted records
Browse files Browse the repository at this point in the history
A record may be deleted already by an earlier call of deleteRecord()
which can occur by deleting records with tt_content IRRE elements
what is done by the gridelements extension.

This prevents the error "Attempt to delete record without delete-permissions"
which occurs in the second attempt where $hasEditAccess is false (as normal editor).

Resolves: #87351
Releases: master, 9.5
Change-Id: Ic697dcfe74f12a66d843deef5ae21d74b6209b69
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/59281
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Benni Mack <benni@typo3.org>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
  • Loading branch information
Christoph Lehmann authored and georgringer committed Mar 9, 2020
1 parent 6f2e956 commit 9dd4c09
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions typo3/sysext/core/Classes/DataHandling/DataHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -4727,6 +4727,10 @@ public function deleteRecord($table, $uid, $noRecordCheck = false, $forceHardDel
$this->log($table, $uid, SystemLogDatabaseAction::DELETE, 0, SystemLogErrorClassification::USER_ERROR, 'Attempt to delete record without delete-permissions. [' . $this->BE_USER->errorMsg . ']');
return;
}
// Skip processing already deleted records
if (!$forceHardDelete && !$undeleteRecord && $this->hasDeletedRecord($table, $uid)) {
return;
}

// Checking if there is anything else disallowing deleting the record by checking if editing is allowed
$deletedRecord = $forceHardDelete || $undeleteRecord;
Expand Down

0 comments on commit 9dd4c09

Please sign in to comment.