Skip to content
Snippets Groups Projects
Commit 78515248 authored by Torben Hansen's avatar Torben Hansen Committed by Oliver Bartsch
Browse files

[BUGFIX] Fix backend layout lookup in page info module

The page info module currently shows a valid page layout as invalid,
because the lookup of backend layouts still uses indexed array keys
instead of associative array keys which were introduced in #99739

This change fixes the problem by using associative array keys
to resolve backend layouts. Additionally, this change ensures,
that the `determinePageId` function in `BackendLayoutView`
does not try to resolve a page id, if the given array is empty.

Resolves: #102687
Related: #99739
Releases: main, 12.4
Change-Id: Iec74aec99c790c8841dbb2db537083503987f9d0
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/82127


Reviewed-by: default avatarOliver Bartsch <bo@cedev.de>
Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarOliver Bartsch <bo@cedev.de>
parent 5ceb5f5a
Branches
Tags
No related merge requests found
...@@ -109,6 +109,10 @@ class BackendLayoutView implements SingletonInterface ...@@ -109,6 +109,10 @@ class BackendLayoutView implements SingletonInterface
*/ */
protected function determinePageId($tableName, array $data) protected function determinePageId($tableName, array $data)
{ {
if (empty($data)) {
return false;
}
if (str_starts_with((string)$data['uid'], 'NEW')) { if (str_starts_with((string)$data['uid'], 'NEW')) {
// negative uid_pid values of content elements indicate that the element // negative uid_pid values of content elements indicate that the element
// has been inserted after an existing element so there is no pid to get // has been inserted after an existing element so there is no pid to get
......
...@@ -536,8 +536,8 @@ class PageInformationController extends InfoModuleController ...@@ -536,8 +536,8 @@ class PageInformationController extends InfoModuleController
$this->backendLayoutView->addBackendLayoutItems($configuration); $this->backendLayoutView->addBackendLayoutItems($configuration);
$backendLayouts = []; $backendLayouts = [];
foreach ($configuration['items'] ?? [] as $backendLayout) { foreach ($configuration['items'] ?? [] as $backendLayout) {
if (($backendLayout[0] ?? false) && ($backendLayout[1] ?? false)) { if (($backendLayout['label'] ?? false) && ($backendLayout['value'] ?? false)) {
$backendLayouts[$backendLayout[1]] = $backendLayout[0]; $backendLayouts[$backendLayout['value']] = $backendLayout['label'];
} }
} }
return $backendLayouts; return $backendLayouts;
......
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