Skip to content

Commit

Permalink
class_exclusion_list not mandatory
Browse files Browse the repository at this point in the history
  • Loading branch information
accognet committed Oct 1, 2024
1 parent a355c43 commit ecbce2e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions core/attributedef.class.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)]);
Expand Down
2 changes: 1 addition & 1 deletion core/trigger.class.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions setup/compiler.class.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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, '');
Expand Down

0 comments on commit ecbce2e

Please sign in to comment.