Skip to content
Snippets Groups Projects
Commit 9cc53bd0 authored by Oliver Bartsch's avatar Oliver Bartsch
Browse files

[BUGFIX] Fix shortcut title generation in EditDocumentController

Since #96154, the shortcut button is invalid in case
no `$displayName` is provided. For such case, the
ButtonBar throws an unhandled exception. The
EditDocumentController previously failed to ensure
that the corresponding value is always properly
set, which therefore led to mentioned exception
in some cases.

To fix this, it's now ensured that `getShortcutTitle()`
does always return a valid title. In case something is
wrong, e.g. no valid query arguments are provided, a
default title is used.

Previously, the `$recordId` in `getShortcutTitle()` was
always directly casted to an int. However, since it is
also possible to edit multiple records, the $recordId`
might be a comma separated list of uids. This case is
now also properly handled.

Note: The `getShortcutTitle()` is since #94182 also
used for the module title. This might be a misuse and
will therefore be further evaluated in another patch.

Resolves: #96337
Related: #96154
Releases: main
Change-Id: I2ec6a5d2ab8d5263315e8fa7194bc887b084ae79
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72632


Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarRiccardo De Contardi <erredeco@gmail.com>
Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarOliver Bartsch <bo@cedev.de>
parent 742cc1df
Branches
Tags
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