#107103\RuntimeException is thrown, when an editor tries to delete a redirect
Description
When an editor tries to delete a redirect record, a \RuntimeException is thrown.
(1/1) #1578950324 RuntimeException
The given page record is invalid. Missing uid.
clipboard-202507161433-mr5be.png
A similar bug has been reported here: https://forge.typo3.org/issues/106928
Reviews 2
Related issues 2
Files 4
History 1216
-
Garvin Hicking changed Related to #106928 <span data-processor="relativetime" data-value="2025-07-16T13:39:02+00:00" > 07/16/25, 13:39 </span>
-
Garvin Hicking commented and changed status
NewNeeds Feedback <span data-processor="relativetime" data-value="2025-07-16T13:55:05+00:00" > 07/16/25, 13:55 </span> -
Moritz Ngo changed attached clipboard-202507171438-byvuf.png <span data-processor="relativetime" data-value="2025-07-17T12:45:13+00:00" > 07/17/25, 12:45 </span>
-
Moritz Ngo changed
clipboard-202507171438-byvuf.png<span data-processor="relativetime" data-value="2025-07-17T13:51:07+00:00" > 07/17/25, 13:51 </span> -
Moritz Ngo commented and changed attached clipboard-202507171438-byvuf.png <span data-processor="relativetime" data-value="2025-07-17T13:56:19+00:00" > 07/17/25, 13:56 </span>
Garvin Hicking wrote in #note-2:
> Could you maybe upload the whole stacktrace to see wherehasPagePermissionis called from?Of course, here’s a screenshot of the stack trace:
clipboard-202507171438-byvuf.pngIf I see that correctly in
DataHandler::deleteRecord()(line 5494), the issue is that$pageRecordis an empty array, whensys_redirectsare stored on pid 0, thus no$pageRecordwill be fetched.
That ultimately results in the\RuntimeExceptionwhen checkinghasPagePermission()EDIT: sorry had to re-upload the file
-
Gerrit Code Review pushed patch set 1 for main to change 90384 status
Needs FeedbackUnder Review <span data-processor="relativetime" data-value="2025-08-13T22:31:26+00:00" > 08/13/25, 22:31 </span> -
Kay Röseler commented and changed attached clipboard-202509171557-91dzz.png attached clipboard-202509171558-v5nlw.png <span data-processor="relativetime" data-value="2025-09-17T13:58:59+00:00" > 09/17/25, 13:58 </span>
Gerrit Code Review wrote in #note-6:
> Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
> It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/90384Hello Core Team,
We have now also encountered this problem during an upgrade project. Unfortunately, the patch offered here is only a partial solution. Although it prevents the runtime exception, user groups are still unable to delete redirects that were created via the backend module (with PID = 0).
clipboard-202509171558-v5nlw.png
Will there be a solution for this soon? Perhaps something similar to the other ticket (Bug #106928) for metadata?
Many thanks and best regards,
KayTranslated with DeepL.com (free version)
-
Moritz Ngo commented <span data-processor="relativetime" data-value="2025-11-13T15:25:54+00:00" > 11/13/25, 15:25 </span>
I’m using the following hacky workaround so editors won’t get the error message:
<?php declare(strict_types=1); namespace My\Namespace\Backend\DataHandling; use Symfony\Component\DependencyInjection\Attribute\Autoconfigure; use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\DataHandling\DataHandler; use TYPO3\CMS\Core\Information\Typo3Version; use TYPO3\CMS\Core\Utility\GeneralUtility; /** * This workaround prevents an exception when editors try to delete sys_redirect records. * It allows the deletion to proceed without throwing an error. * see https://forge.typo3.org/issues/107103 */ #[Autoconfigure(public: true, shared: true)] class WorkaroundToPreventExceptionWhenTryingToDeleteSysRedirectRecord { /** * @param array<string, mixed> $recordToDelete */ public function processCmdmap_deleteAction( string $table, int $uid, array $recordToDelete, bool &$recordWasDeleted, DataHandler $pObj, ): void { $version = GeneralUtility::makeInstance(Typo3Version::class); if ($version->getMajorVersion() < 13) { return; } if ($table !== 'sys_redirect') { return; } // No need to apply workaround for admin users /** @extensionScannerIgnoreLine #100454 #100963 */ if ($pObj->BE_USER->isAdmin()) { return; } $pObj->deleteEl($table, $uid, true); $record = BackendUtility::getRecord($table, $uid, '*', '', false); if ($record === null) { $recordWasDeleted = true; return; } $recordWasDeleted = (bool)($record['deleted'] ?? false); } }You have to register the Hook in your
ext_localconf.php:$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'][] = WorkaroundToPreventExceptionWhenTryingToDeleteSysRedirectRecord::class; -
Christian Kuhn changed Duplicated by #108350 <span data-processor="relativetime" data-value="2025-12-08T16:06:41+00:00" > 12/08/25, 16:06 </span>
-
Christian Kuhn commented <span data-processor="relativetime" data-value="2025-12-08T16:17:18+00:00" > 12/08/25, 16:17 </span>
I think the main issue is here that the “casual” process_cmdmap / process_datamap DataHandler API can not circumvent access checks (which is an important security measure since these array are usually comming from GET/POST). One solution would be to call DH->deleteAction() with $noAccessCheck = true directly, which means routing not to tce_db for such commands, but through the controller. ext:recycler does a similar thing for instance.
the reported exception is “just” a follow up issue, and changing this then surfaces the main issue as found by Kay already.
-
Josef Glatz changed priority
Should haveMust have <span data-processor="relativetime" data-value="2026-01-07T10:05:04+00:00" > 01/07/26, 10:05 </span> -
Peter Kraume changed Related to #107432 <span data-processor="relativetime" data-value="2026-03-30T21:38:17+00:00" > 03/30/26, 21:38 </span>
-
Gerrit Code Review pushed patch set 2 for main to change 90384 <span data-processor="relativetime" data-value="2026-04-21T14:42:29+00:00" > 04/21/26, 14:42 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 90384 <span data-processor="relativetime" data-value="2026-09-11T22:51:05+00:00" > 09/11/26, 22:51 </span>
-
Gerrit Code Review pushed patch set 1 for 14.3 to change 95801 <span data-processor="relativetime" data-value="2026-09-14T06:48:14+00:00" > 09/14/26, 06:48 </span>
-
Benni Mack commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-09-14T06:50:10+00:00" > 09/14/26, 06:50 </span>Applied in changeset commit:b5596c88a7c63569416b9e7b95505be8c65020b6.
Could you maybe upload the whole stacktrace to see where
hasPagePermissionis called from?