From 41126c795f89974baaef2205894d370047e7654c Mon Sep 17 00:00:00 2001 From: Denny Lubitz Date: Tue, 30 Jan 2024 20:14:31 +0100 Subject: [PATCH 1/2] BUGFIX: Allow dimension preset keys to be different from values for DimensionsMenu --- .../Classes/Fusion/DimensionsMenuItemsImplementation.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Neos.Neos/Classes/Fusion/DimensionsMenuItemsImplementation.php b/Neos.Neos/Classes/Fusion/DimensionsMenuItemsImplementation.php index 0bfa17b36c0..06a596e2785 100644 --- a/Neos.Neos/Classes/Fusion/DimensionsMenuItemsImplementation.php +++ b/Neos.Neos/Classes/Fusion/DimensionsMenuItemsImplementation.php @@ -77,7 +77,7 @@ protected function buildItems() foreach ($this->contentDimensionCombinator->getAllAllowedCombinations() as $allowedCombination) { $targetDimensions = $this->calculateTargetDimensionsForCombination($allowedCombination); - + $presets = $this->configurationContentDimensionPresetSource->findPresetsByTargetValues($allowedCombination); if ($pinnedDimensionName !== null && is_array($pinnedDimensionValues)) { if (!in_array($targetDimensions[$pinnedDimensionName], $pinnedDimensionValues)) { continue; @@ -105,13 +105,13 @@ protected function buildItems() } // determine metadata for target dimensions of node - array_walk($targetDimensions, static function (&$dimensionValue, $dimensionName, $allDimensionPresets) use ($pinnedDimensionName) { + array_walk($targetDimensions, function (&$dimensionValue, $dimensionName) use ($pinnedDimensionName, $presets) { $dimensionValue = [ 'value' => $dimensionValue, - 'label' => $allDimensionPresets[$dimensionName]['presets'][$dimensionValue]['label'], + 'label' => $presets[$dimensionName]['label'], 'isPinnedDimension' => $pinnedDimensionName === null || $dimensionName == $pinnedDimensionName ]; - }, $allDimensionPresets); + }); $menuItems[] = [ 'node' => $nodeInDimensions, From 7cfe27a25093f7f74b0caaabba740621cf8cb2a4 Mon Sep 17 00:00:00 2001 From: Denny Lubitz Date: Tue, 30 Jan 2024 20:23:30 +0100 Subject: [PATCH 2/2] BUGFIX: Allow dimension preset keys to be different from values for DimensionsMenu --- Neos.Neos/Classes/Fusion/DimensionsMenuItemsImplementation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Neos.Neos/Classes/Fusion/DimensionsMenuItemsImplementation.php b/Neos.Neos/Classes/Fusion/DimensionsMenuItemsImplementation.php index 06a596e2785..2006ad2e61d 100644 --- a/Neos.Neos/Classes/Fusion/DimensionsMenuItemsImplementation.php +++ b/Neos.Neos/Classes/Fusion/DimensionsMenuItemsImplementation.php @@ -105,7 +105,7 @@ protected function buildItems() } // determine metadata for target dimensions of node - array_walk($targetDimensions, function (&$dimensionValue, $dimensionName) use ($pinnedDimensionName, $presets) { + array_walk($targetDimensions, static function (&$dimensionValue, $dimensionName) use ($pinnedDimensionName, $presets) { $dimensionValue = [ 'value' => $dimensionValue, 'label' => $presets[$dimensionName]['label'],