Skip to content

Commit

Permalink
[BUGFIX] Fix typo in PageDoktypeProvider
Browse files Browse the repository at this point in the history
Resolves: #99557
Releases: main
Change-Id: Idf145a98aa3fd386ff9906a4ee9cf5f0593fe8a3
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/77397
Tested-by: core-ci <typo3@b13.com>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Oliver Bartsch <bo@cedev.de>
Tested-by: Oliver Bartsch <bo@cedev.de>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Reviewed-by: Benni Mack <benni@typo3.org>
  • Loading branch information
o-ba committed Jan 16, 2023
1 parent 3cbf82a commit 52a9b90
Showing 1 changed file with 5 additions and 4 deletions.
Expand Up @@ -29,12 +29,13 @@ public function __construct(protected readonly PageDoktypeRegistry $doktypeRegis
public function getConfiguration(): array
{
$configuration = [];
$languageService = $this->getLanguageService();
$allLabels = $this->prepareLabelsForAllTypes();
$providerConfiguration = $this->doktypeRegistry->exportConfiguration();
ksort($providerConfiguration);
foreach ($providerConfiguration as $pageType => $typeConfiguration) {
if (isset($allLabels[$pageType])) {
$configuration[$pageType] = array_merge_recursive(['name' => $this->getLanguageService()->sL($allLabels[$pageType])], $typeConfiguration);
$configuration[$pageType] = array_merge_recursive(['name' => $languageService->sL($allLabels[$pageType])], $typeConfiguration);
} else {
$configuration[$pageType] = $typeConfiguration;
}
Expand All @@ -45,9 +46,9 @@ public function getConfiguration(): array
protected function prepareLabelsForAllTypes(): array
{
$types = [];
foreach ($GLOBALS['TCA']['pages']['columns']['doktype']['config']['items'] as $itm) {
if (MathUtility::canBeInterpretedAsInteger($itm[1])) {
$types[(int)$itm[1]] = $itm[0];
foreach ($GLOBALS['TCA']['pages']['columns']['doktype']['config']['items'] as $item) {
if (MathUtility::canBeInterpretedAsInteger($item[1])) {
$types[(int)$item[1]] = $item[0];
}
}
return $types;
Expand Down

0 comments on commit 52a9b90

Please sign in to comment.