From ecbce2e4b551b3530db84bb3f961c54680722805 Mon Sep 17 00:00:00 2001 From: Anne-Cath Date: Tue, 1 Oct 2024 10:01:41 +0200 Subject: [PATCH] class_exclusion_list not mandatory --- core/attributedef.class.inc.php | 4 ++-- core/trigger.class.inc.php | 2 +- setup/compiler.class.inc.php | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/core/attributedef.class.inc.php b/core/attributedef.class.inc.php index fa588ab67c..d96f2e9652 100644 --- a/core/attributedef.class.inc.php +++ b/core/attributedef.class.inc.php @@ -3793,7 +3793,7 @@ class AttributeClass extends AttributeString public static function ListExpectedParams() { - return array_merge(parent::ListExpectedParams(), array('class_category', 'more_values', 'class_exclusion_list')); + return array_merge(parent::ListExpectedParams(), array('class_category', 'more_values')); } public function __construct($sCode, $aParams) @@ -3835,7 +3835,7 @@ public function GetAllowedValues($aArgs = array(), $sContains = '') $aListClass = $oValSetDef->GetValues($aArgs, $sContains); - $sClassExclusionList = $this->Get('class_exclusion_list'); + $sClassExclusionList = $this->GetOptional('class_exclusion_list',null); if (!empty($sClassExclusionList)) { foreach (explode(',', $sClassExclusionList) as $sClassName) { unset($aListClass[trim($sClassName)]); diff --git a/core/trigger.class.inc.php b/core/trigger.class.inc.php index 84b8452d0a..0b3e5e38e7 100644 --- a/core/trigger.class.inc.php +++ b/core/trigger.class.inc.php @@ -419,7 +419,7 @@ public static function Init() ); MetaModel::Init_Params($aParams); MetaModel::Init_InheritAttributes(); - MetaModel::Init_AddAttribute(new AttributeClassState("state", array("class_field" => 'target_class', "allowed_values" => null, "sql" => "state", "default_value" => null, "is_null_allowed" => false, "depends_on" => array('target_class'), "class_exclusion_list" => null))); + MetaModel::Init_AddAttribute(new AttributeClassState("state", array("class_field" => 'target_class', "allowed_values" => null, "sql" => "state", "default_value" => null, "is_null_allowed" => false, "depends_on" => array('target_class')))); // Display lists MetaModel::Init_SetZListItems('details', array('description', 'context', 'target_class', 'filter', 'state', 'subscription_policy', 'action_list')); // Attributes to be displayed for the complete details diff --git a/setup/compiler.class.inc.php b/setup/compiler.class.inc.php index 1b542daf22..8dab806852 100644 --- a/setup/compiler.class.inc.php +++ b/setup/compiler.class.inc.php @@ -2200,8 +2200,6 @@ protected function CompileAttribute(string $sAttType, DOMElement $oField, string $this->CompileCommonProperty('attribute_definition_exclusion_list', $oField, $aParameters, $sModuleRelativeDir, ''); $this->CompileCommonProperty('allowed_values', $oField, $aParameters, $sModuleRelativeDir); $aParameters['depends_on'] = $sDependencies; - } elseif ($sAttType == 'AttributeClass') { - $this->CompileCommonProperty('class_exclusion_list', $oField, $aParameters, $sModuleRelativeDir, ''); } elseif ($sAttType == 'AttributeEnumSet') { $oValues = $oField->GetUniqueElement('values'); $oValueNodes = $oValues->getElementsByTagName('value'); @@ -2261,10 +2259,12 @@ protected function CompileAttribute(string $sAttType, DOMElement $oField, string $this->CompileCommonProperty('is_null_allowed', $oField, $aParameters, $sModuleRelativeDir, false); $this->CompileCommonProperty('default_value', $oField, $aParameters, $sModuleRelativeDir, ''); $this->CompileCommonProperty('allowed_values', $oField, $aParameters, $sModuleRelativeDir); - $aParameters['class_category'] = $this->GetPropString($oField, 'class_category', ''); + $aParameters['class_category'] = $this->GetPropString($oField, 'class_category', ''); $aParameters['more_values'] = $this->GetPropString($oField, 'more_values', ''); $aParameters['depends_on'] = $sDependencies; - }else { + $aParameters['class_exclusion_list'] = $this->GetPropString($oField, 'class_exclusion_list', null); + + }else { $this->CompileCommonProperty('sql', $oField, $aParameters, $sModuleRelativeDir); $this->CompileCommonProperty('is_null_allowed', $oField, $aParameters, $sModuleRelativeDir, false); $this->CompileCommonProperty('default_value', $oField, $aParameters, $sModuleRelativeDir, '');