Project

General

Profile

Actions

Bug #104496

closed

PHP warnings with broken backend shortcuts

Added by Florian Seirer 4 months ago. Updated about 1 month ago.

Status:
Closed
Priority:
Should have
Category:
Backend User Interface
Target version:
-
Start date:
2024-07-29
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
8.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

After migrating from PHP 7.4 to 8.2 I found some PHP warning messages in my logs, which were caused by backend shortcuts pointing to non-existent records:

Core: Error handler (BE): PHP Warning: Undefined array key "recordid" in /.../typo3/sysext/backend/Classes/Backend/Shortcut/ShortcutRepository.php line 640
Core: Error handler (BE): PHP Warning: Undefined array key "table" in /.../typo3/sysext/backend/Classes/Backend/Shortcut/ShortcutRepository.php line 639
Core: Error handler (BE): PHP Warning: Undefined array key "edit" in /.../typo3/sysext/backend/Classes/Backend/Shortcut/ShortcutRepository.php line 478

All three messages were caused by the same broken shortcut. After deleting the broken shortcut the error messages didn't occur again.
No errors were visible using the live preset, though.
It's worse when using the debug preset, because the user can't even log into the backend.

The shortcut causing this had uid=433. uid=306 doesn't make sense, either, but it's not visible in the shortcut dropdown and does not produce warnings in the logs.

Still, IMO broken shortcuts should be deleted when the record is deleted as well (sounds easier than it probably is, I know). And maybe there is a way to identify and clean up broken shortcuts? Manually this could be done with SQL by deleting all records from sys_be_shortcuts with empty route/arguments fields.

I'm also not sure how this shortcut was created in the first place. This particular TYPO3 installation started with TYPO3 3.8 about 20 years ago, and the user was created in 2009...

Tested on TYPO3 11.5.38, but the code in ShortcutRepository.php looks similar in TYPO3 12.


Files

clipboard-202407291350-jmi9u.png (9.83 KB) clipboard-202407291350-jmi9u.png Florian Seirer, 2024-07-29 11:50
Actions

Also available in: Atom PDF