mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 08:09:41 +00:00
util:legacy - ignore plugins_interfaces() errors in write_config() when called without sufficient imports (missing libraries in registered plugins).
Scripts like https://github.com/opnsense/core/blob/master/src/etc/rc.expireaccounts will die horribly at the moment when there's actual work to be done (although this example should likely be rmeoved for 25.1 anyway)
This commit is contained in:
parent
988dbae92d
commit
be8841d9af
@ -197,7 +197,20 @@ function write_config($desc = '', $backup = true)
|
||||
}
|
||||
}
|
||||
|
||||
plugins_interfaces();
|
||||
/**
|
||||
* XXX: Temporary construction.
|
||||
* When called via a legacy interface configure page, we might want to register new interfaces, but
|
||||
* in cases we just want to save our changes (not related to interfaces), we risk raising errors for
|
||||
* missing imports.
|
||||
* Eventually relevant callers should call 'interface invoke registration', which is the same as
|
||||
* mvc components use now (but can't be called here without side effects)
|
||||
*/
|
||||
try {
|
||||
plugins_interfaces();
|
||||
} catch (Throwable $e) {
|
||||
null;
|
||||
}
|
||||
|
||||
|
||||
$cnf = OPNsense\Core\Config::getInstance();
|
||||
$cnf->fromArray($config);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user