Skip to content

Commit

Permalink
fix: Handle sections with only 1 entry type properly ([#1557](#1557))
Browse files Browse the repository at this point in the history
  • Loading branch information
khalwat committed Jan 14, 2025
1 parent e22461e commit abe7e8a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/controllers/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ public function actionEditContent(
$variables['typeMenu'] = $typeMenu;
$variables['currentTypeId'] = null;
$variables['specificTypeId'] = null;
if (!empty($typeMenu)) {
if (count($typeMenu) > 1) {
$currentType = reset($typeMenu);
$variables['currentType'] = $typeMenu[$typeId] ?? $currentType;
$variables['currentTypeId'] = $typeId ?? key($typeMenu);
Expand All @@ -541,8 +541,7 @@ public function actionEditContent(
// If there's only one EntryType, don't bother displaying the menu
if (count($typeMenu) === 1) {
$variables['typeMenu'] = [];
$variables['specificTypeId'] = $typeId;
$typeId = null;
$variables['specificTypeId'] = $typeId ?? key($typeMenu);
}
$pluginName = Seomatic::$settings->pluginName;
// Asset bundle
Expand Down

0 comments on commit abe7e8a

Please sign in to comment.