From 23a504d9d5e115725776070eff69a2ac57eb46ca Mon Sep 17 00:00:00 2001 From: Luke Towers Date: Tue, 20 Mar 2018 13:40:14 -0600 Subject: [PATCH] Allow settings models and controllers to be defined in one definition This change allows both settings models and custom settings controllers to be registered in one definition by preventing overwriting of the provided `url` when present. This enables the use case of extending the base \System\Controllers\Settings controller to implement custom functionality on your settings controller while retaining the majority of the default functionality enabled through the use of a SettingsModel. --- modules/system/classes/SettingsManager.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/system/classes/SettingsManager.php b/modules/system/classes/SettingsManager.php index b950129d9..9b4b7f781 100644 --- a/modules/system/classes/SettingsManager.php +++ b/modules/system/classes/SettingsManager.php @@ -264,9 +264,9 @@ class SettingsManager ])); /* - * Link to the generic settings page + * Link to the generic settings page if a URL is not provided */ - if (isset($item['class'])) { + if (isset($item['class']) && !isset($item['url'])) { $uri = []; if (strpos($owner, '.') !== null) {