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.
This commit is contained in:
Luke Towers 2018-03-20 13:40:14 -06:00 committed by GitHub
parent e3635b80e7
commit 23a504d9d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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) {