Skip to content

Commit

Permalink
Fix undefined array key bug
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Hamacher <m.hamacher@basecom.de>
  • Loading branch information
matthiashamacher committed Apr 26, 2024
1 parent bb0916a commit 2d8d90e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Controller/Admin/IndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ protected function buildPimcoreSettings(
$config = $templateParams['config'];
$systemSettings = $templateParams['systemSettings'];
$adminSettings = $templateParams['adminSettings'];
$requiredLanguages = $systemSettings['general']['valid_languages'];
$dashboardHelper = new Dashboard($user);
$customAdminEntrypoint = $this->getParameter('pimcore_admin.custom_admin_route_name');

Expand All @@ -206,7 +207,9 @@ protected function buildPimcoreSettings(
$adminEntrypointUrl = null;
}

$requiredLanguages = $systemSettings['general']['required_languages'];
if (array_key_exists('required_languages', $systemSettings['general'])) {
$requiredLanguages = $systemSettings['general']['required_languages'];
}

$settings = [
'instanceId' => $this->getInstanceId(),
Expand All @@ -226,7 +229,7 @@ protected function buildPimcoreSettings(
$systemSettings['general']['valid_languages'],
true
),
'requiredLanguages' => $requiredLanguages ?: $systemSettings['general']['valid_languages'],
'requiredLanguages' => $requiredLanguages,

// flags
'showCloseConfirmation' => true,
Expand Down

0 comments on commit 2d8d90e

Please sign in to comment.