N°8198 - ModuleInstallation now extends DBObject + better exception message

This commit is contained in:
jf-cbd
2025-06-02 16:09:29 +02:00
committed by GitHub
parent 5ae5221f6f
commit 657fc912bf
2 changed files with 4 additions and 2 deletions

View File

@@ -25,7 +25,7 @@
* @license http://opensource.org/licenses/AGPL-3.0
*/
class ModuleInstallation extends cmdbAbstractObject
class ModuleInstallation extends DBObject
{
public static function Init()
{

View File

@@ -82,7 +82,9 @@ class ObjectController extends AbstractController
{
throw new ApplicationException(Dict::Format('UI:Error:1ParametersMissing', 'class'));
}
if (!is_subclass_of($sClass, cmdbAbstractObject::class)) {
throw new SecurityException('The class "'.$sClass.'" is not a subclass of cmdbAbstractObject so it can\'t be created by the user');
}
// If the specified class has subclasses, ask the user an instance of which class to create
$aSubClasses = MetaModel::EnumChildClasses($sClass, ENUM_CHILD_CLASSES_ALL); // Including the specified class itself
$aPossibleClasses = array();