Loading CHANGELOG.md +6 −0 Original line number Diff line number Diff line CHANGELOG ========= 6.0.14 ------ - [FIX] FormElementCollection : forçage d'id pour éviter les doubons provoqué par le clonage (SearchAndSelect ne le supporte pas) ! - [FIX] FormElementCollection : correction d'un auto-sabotage ! 6.0.13 ------ Loading src/UnicaenApp/Form/View/Helper/FormElementCollection.php +12 −2 Original line number Diff line number Diff line Loading @@ -61,6 +61,8 @@ class FormElementCollection extends FormCollection $index=0; $markup = ''; $linkMarkup = ''; $javascript = null; $css = null; $templateMarkup = ''; $elementHelper = $this->getElementHelper(); $fieldsetHelper = $this->getFieldsetHelper(); Loading @@ -83,6 +85,14 @@ class FormElementCollection extends FormCollection $markup .= $fieldsetHelper($elementOrFieldset, $this->shouldWrap()); $index++; } elseif ($elementOrFieldset instanceof ElementInterface) { if ($element instanceof FieldsetInterface) { $domId = $elementOrFieldset->getAttribute('id') ?: uniqid('element-'); $elementOrFieldset->setAttribute('id', $domId . '-__index__'); // NB : la valeur d'un id doit être unique dans un DOM. Or, en cas de collection autorisant l'ajout d'élément // (par clonage), on garantit l'unicité en concaténant le pattern '__index__', pattern qui est remplacé/incrémenté // par le moteur js de cette aide de vue (cf. plus bas). /** Par ex, {@see \UnicaenApp\Form\Element\SearchAndSelect} ne fonctionne plus dans une collection en cas de doublon d'id. */ } $markup .= $elementHelper($elementOrFieldset); } } Loading Loading @@ -122,8 +132,8 @@ class FormElementCollection extends FormCollection $templateMarkup, $attributesString, $linkMarkup, $css = null, $javascript = null, $css, $javascript, ); } else { $markup .= $templateMarkup . $linkMarkup; Loading Loading
CHANGELOG.md +6 −0 Original line number Diff line number Diff line CHANGELOG ========= 6.0.14 ------ - [FIX] FormElementCollection : forçage d'id pour éviter les doubons provoqué par le clonage (SearchAndSelect ne le supporte pas) ! - [FIX] FormElementCollection : correction d'un auto-sabotage ! 6.0.13 ------ Loading
src/UnicaenApp/Form/View/Helper/FormElementCollection.php +12 −2 Original line number Diff line number Diff line Loading @@ -61,6 +61,8 @@ class FormElementCollection extends FormCollection $index=0; $markup = ''; $linkMarkup = ''; $javascript = null; $css = null; $templateMarkup = ''; $elementHelper = $this->getElementHelper(); $fieldsetHelper = $this->getFieldsetHelper(); Loading @@ -83,6 +85,14 @@ class FormElementCollection extends FormCollection $markup .= $fieldsetHelper($elementOrFieldset, $this->shouldWrap()); $index++; } elseif ($elementOrFieldset instanceof ElementInterface) { if ($element instanceof FieldsetInterface) { $domId = $elementOrFieldset->getAttribute('id') ?: uniqid('element-'); $elementOrFieldset->setAttribute('id', $domId . '-__index__'); // NB : la valeur d'un id doit être unique dans un DOM. Or, en cas de collection autorisant l'ajout d'élément // (par clonage), on garantit l'unicité en concaténant le pattern '__index__', pattern qui est remplacé/incrémenté // par le moteur js de cette aide de vue (cf. plus bas). /** Par ex, {@see \UnicaenApp\Form\Element\SearchAndSelect} ne fonctionne plus dans une collection en cas de doublon d'id. */ } $markup .= $elementHelper($elementOrFieldset); } } Loading Loading @@ -122,8 +132,8 @@ class FormElementCollection extends FormCollection $templateMarkup, $attributesString, $linkMarkup, $css = null, $javascript = null, $css, $javascript, ); } else { $markup .= $templateMarkup . $linkMarkup; Loading