Commit a6f21085 authored by Oliver Bartsch's avatar Oliver Bartsch
Browse files

[BUGFIX] Prevent PHP warning in OpendocsToolbarItem

In case a record from a no longer existing
table is stored as recently opened in the
user session, a PHP warning is triggered
whenever the toolbar items are updated
(e.g. because user opens another record).

This is fixed by adding corresponding fallbacks.

Resolves: #96075
Releases: master, 11.5
Change-Id: Ia99371711f2a8ef9fa6a96844476148674b5b843
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72285

Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Nikita Hovratov's avatarNikita Hovratov <nikita.h@live.de>
Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Oliver Klee's avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Nikita Hovratov's avatarNikita Hovratov <nikita.h@live.de>
Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
parent 92a150d6
......@@ -161,8 +161,8 @@ class OpendocsToolbarItem implements ToolbarItemInterface
*/
protected function getMenuEntry(array $document, string $identifier): array
{
$table = $document[3]['table'];
$uid = $document[3]['uid'];
$table = $document[3]['table'] ?? '';
$uid = $document[3]['uid'] ?? 0;
$record = BackendUtility::getRecordWSOL($table, $uid);
if (!is_array($record)) {
......
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