N°8772 - dynamic form

This commit is contained in:
Benjamin Dalsass
2025-11-12 09:33:29 +01:00
parent cbb0e2ef7e
commit 3d2485a004
3 changed files with 4 additions and 8 deletions

View File

@@ -168,15 +168,9 @@ class DependencyHandler
if ($oDependentBlock->IsVisible($sEventType) && $oDependentBlock->IsInputsDataReady($sEventType)) {
// Get the dependent field options
$aBefore = $oDependentBlock->GetOptionsMergedWithDynamic();
$oDependentBlock->UpdateDynamicOptions($sEventType);
$aOptions = $oDependentBlock->GetOptionsMergedWithDynamic($sEventType);
// Options changed flag
$bOptionsChanged = FormHelper::CompareArrayValues($aBefore, $aOptions);
$bOptionsChanged = true;
// Add the listener callback to the dependent field if it is also a dependency for another field
if ($this->oDependenciesMap->IsTheBlockInDependencies($oDependentBlock->getName())) {
@@ -186,7 +180,7 @@ class DependencyHandler
]);
}
if ( (!$oDependentBlock->IsAdded() || $bOptionsChanged) && $oDependentBlock->AllowAdd($sEventType)) {
if ($oDependentBlock->AllowAdd($sEventType)) {
// Add events
$this->AddEvent('form.add', $oDependentBlock->getName());