mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 19:19:19 +02:00
fix: partials must not unset caller-owned $formData
fieldset-academic.php, fieldset-metadata.php and fieldset-licence-explanation.php were each calling unset($formData) (or wrong variable) in their cleanup block, destroying the variable in the parent renderShareLinkForm() scope. This caused an Undefined variable / TypeError on old($formData, ...) for any field rendered after those partials (e.g. confirmation_email at line 328). Fix: remove $formData from the unset() calls; fieldset-licence-explanation.php was also unsetting the wrong name — corrected to unset($n) which is the variable it actually declares.
This commit is contained in:
2
TODO.md
2
TODO.md
@@ -12,6 +12,8 @@
|
|||||||
## Bug fixes
|
## Bug fixes
|
||||||
|
|
||||||
- [x] Fix `$enabledAccessTypes` undefined / `array_map()` TypeError on edit page — controller was fetching `getAccessTypes()` instead of `getEnabledFormAccessTypes()` and returning it under the wrong key
|
- [x] Fix `$enabledAccessTypes` undefined / `array_map()` TypeError on edit page — controller was fetching `getAccessTypes()` instead of `getEnabledFormAccessTypes()` and returning it under the wrong key
|
||||||
|
- [x] Fix fatal TypeError: `old()` called with wrong arity in `jury-fieldset.php` partial under partage context — removed `?: null` coercions so `$juryPresident`/`$juryPromoteur` are `''` not `null`, keeping `$addMode` false
|
||||||
|
- [x] Fix `$formData` destroyed by included partials (`fieldset-academic.php`, `fieldset-metadata.php`, `fieldset-licence-explanation.php` were incorrectly unsetting `$formData`/wrong variable in caller scope)
|
||||||
|
|
||||||
## Form help blocks — sortable admin UI
|
## Form help blocks — sortable admin UI
|
||||||
|
|
||||||
|
|||||||
@@ -59,4 +59,4 @@ $formData = $formData ?? [];
|
|||||||
?>
|
?>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<?php
|
<?php
|
||||||
unset($oldFn, $withAutofocusFn, $formData);
|
unset($oldFn, $withAutofocusFn);
|
||||||
|
|||||||
@@ -58,4 +58,4 @@ $formData = $formData ?? [];
|
|||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<?php
|
<?php
|
||||||
unset($formData);
|
unset($n);
|
||||||
|
|||||||
@@ -60,4 +60,4 @@ $selectedAccessType = isset($formData['access_type_id'])
|
|||||||
?>
|
?>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<?php
|
<?php
|
||||||
unset($oldFn, $withAutofocusFn, $formData, $defaultAccessTypeId, $showDescription, $accessOptions, $selectedAccessType);
|
unset($oldFn, $withAutofocusFn, $defaultAccessTypeId, $showDescription, $accessOptions, $selectedAccessType);
|
||||||
|
|||||||
Reference in New Issue
Block a user