Skip to content

Commit

Permalink
[BUGFIX] Return redirect instead of a ForwardResponse
Browse files Browse the repository at this point in the history
After deleting a log entry, the user must be properly redirected to the
list action.

Resolves: #102003
Releases: main, 12.4
Change-Id: I6caf8fb958acc92823d83fcacac6276ec7ab1d25
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/81195
Reviewed-by: Benjamin Franzke <ben@bnf.dev>
Tested-by: Benjamin Franzke <ben@bnf.dev>
Tested-by: core-ci <typo3@b13.com>
  • Loading branch information
georgringer authored and bnf committed Sep 25, 2023
1 parent dc94208 commit c9dc2b5
Showing 1 changed file with 2 additions and 3 deletions.
Expand Up @@ -29,7 +29,6 @@
use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Http\ForwardResponse;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
Expand Down Expand Up @@ -137,11 +136,11 @@ public function deleteMessageAction(int $errorUid): ResponseInterface
$logEntry = $this->logEntryRepository->findByUid($errorUid);
if (!$logEntry) {
$this->addFlashMessage(LocalizationUtility::translate('actions.delete.noRowFound', 'belog') ?? '', '', ContextualFeedbackSeverity::WARNING);
return new ForwardResponse('list');
return $this->redirect('list');
}
$numberOfDeletedRows = $this->logEntryRepository->deleteByMessageDetails($logEntry);
$this->addFlashMessage(sprintf(LocalizationUtility::translate('actions.delete.message', 'belog') ?? '', $numberOfDeletedRows));
return new ForwardResponse('list');
return $this->redirect('list');
}

/**
Expand Down

0 comments on commit c9dc2b5

Please sign in to comment.