disabled direct actions for deactivated modules (because of duplicate modules)

This commit is contained in:
Jean-Christian Paul Denis 2023-05-14 16:36:52 +02:00
parent 21db8ace76
commit 645404c82d
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951

View File

@ -75,11 +75,15 @@ class Backend extends dcNsProcess
/** /**
* Perfom direct action on module deletion. * Perfom direct action on module deletion.
* *
* This does not perform action on disabled module.
*
* @param dcModuleDefine $define The module * @param dcModuleDefine $define The module
*/ */
protected static function moduleBeforeDelete(dcModuleDefine $define): void protected static function moduleBeforeDelete(dcModuleDefine $define): void
{ {
if (dcCore::app()->blog?->settings->get('system')->get('no_uninstall_direct')) { if (dcCore::app()->blog?->settings->get('system')->get('no_uninstall_direct')
|| $define->get('state') != dcModuleDefine::STATE_ENABLED
) {
return; return;
} }