Commit 168a50dd authored by Andreas Fernandez's avatar Andreas Fernandez
Browse files

Revert "[TASK] Fix undefined array key error in DataHandler logs"

This reverts commit 84a5e867.

Reason for revert:

The proposed and merged solution of #95066 has some undetected flaws:

* array unpacking fails if the array is associative (happens with SU
  mode, see https://github.com/TYPO3/typo3/blob/master/typo3/sysext/core/Classes/Error/ErrorHandler.php#L254)
* assumes all required arguments for sprintf() are available

Since both cases cannot be solved in a clean way it's better to revert the original patch and fix only the original issue.

Change-Id: Ib7811f6174d517e4b7c24f53b9e0d93c8914d5a1
Reverts: #95066
Resolves: #95469
Releases: master
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/71357

Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Oliver Klee's avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
parent 4f9dcd17
......@@ -8855,8 +8855,10 @@ class DataHandler implements LoggerAwareInterface
while ($row = $result->fetchAssociative()) {
$log_data = unserialize($row['log_data']) ?: [];
$msg = $row['error'] . ': ' . sprintf($row['details'], ...$log_data);
$msg = $row['error'] . ': ' . sprintf($row['details'], $log_data[0] ?? '', $log_data[1] ?? '', $log_data[2] ?? '', $log_data[3] ?? '', $log_data[4] ?? '');
/** @var FlashMessage $flashMessage */
$flashMessage = GeneralUtility::makeInstance(FlashMessage::class, $msg, '', $row['error'] === SystemLogErrorClassification::WARNING ? FlashMessage::WARNING : FlashMessage::ERROR, true);
/** @var FlashMessageService $flashMessageService */
$flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
$defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
$defaultFlashMessageQueue->enqueue($flashMessage);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment