From b9070118842948e40c0759b34c68bcbd91c5e978 Mon Sep 17 00:00:00 2001 From: Lars Kaltefleiter Date: Fri, 24 Apr 2026 11:28:06 +0200 Subject: [PATCH] :bug: Only offer states from classes with a lifecycle in AttributeClassState MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When enumerating allowed states in AttributeClassState::GetAllowedValues(), child classes that have a state attribute but no lifecycle transitions (stimuli) were included. TriggerOnStateChange only fires on actual lifecycle state changes, so states from classes without a lifecycle would never trigger — but were still offered in the UI. Fix: skip child classes where MetaModel::HasLifecycle() returns false. --- sources/Core/AttributeDefinition/AttributeClassState.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sources/Core/AttributeDefinition/AttributeClassState.php b/sources/Core/AttributeDefinition/AttributeClassState.php index 33971e74fe..24fd5f9a97 100644 --- a/sources/Core/AttributeDefinition/AttributeClassState.php +++ b/sources/Core/AttributeDefinition/AttributeClassState.php @@ -50,6 +50,9 @@ public function GetAllowedValues($aArgs = [], $sContains = '') $aAllowedStates = []; foreach (MetaModel::EnumChildClasses($sClass, ENUM_CHILD_CLASSES_ALL) as $sChildClass) { + if (!MetaModel::HasLifecycle($sChildClass)) { + continue; + } $aValues = MetaModel::EnumStates($sChildClass); foreach (array_keys($aValues) as $sState) { $aAllowedStates[$sState] = $sState.' ('.MetaModel::GetStateLabel($sChildClass, $sState).')';