diff --git a/code/ModelAdmin.php b/code/ModelAdmin.php index 0840b04e1..84f8621c8 100644 --- a/code/ModelAdmin.php +++ b/code/ModelAdmin.php @@ -538,9 +538,14 @@ public function getManagedModels() // Normalize models to have their model class in array key foreach ($models as $k => $v) { + // No custom tab url segment if (is_numeric($k)) { $models[$v] = ['dataClass' => $v, 'title' => singleton($v)->i18n_plural_name()]; unset($models[$k]); + // Custom tab url segment but no custom title + } elseif (is_a($v, DataObject::class, true)) { + $models[$k] = ['dataClass' => $v, 'title' => singleton($v)->i18n_plural_name()]; + // Custom title but no custom tab url segment } elseif (is_array($v) && !isset($v['dataClass'])) { $models[$k]['dataClass'] = $k; }