Commit 12b8c3a9 authored by Georg Ringer's avatar Georg Ringer
Browse files

[BUGFIX] Show 1st constants section if no category selected

If the admin visits the constants editor the 1st time or the user
settings are resetted, the constants editor must show the constants of
the 1st category.

Resolves: #97603
Releases: main
Change-Id: Ib05ed79a4e79859f5bc5229fd4a50a24f4ce1805
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74600

Reviewed-by: Oliver Klee's avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
parent 9f0faa43
......@@ -115,6 +115,9 @@ class ConstantEditorController extends AbstractTemplateModuleController
$availableCategories = $this->getCategoryLabels($this->categories);
$currentCategory = (string)$moduleData->get('constant_editor_cat');
if (!empty($availableCategories)) {
if ($currentCategory === '') {
$currentCategory = array_key_first($availableCategories);
}
$view->assign('constantsMenu', BackendUtility::getDropdownMenu($pageId, 'constant_editor_cat', $currentCategory, $availableCategories, '', '', ['id' => 'constant_editor_cat']));
}
$view->assignMultiple([
......
Markdown is supported
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