Is there an existing issue for this?
Environment
- OS: FreeBSD jail (source install)
- PHP: 8.4
- LDAP Server: OpenLDAP
PLA Code
Github checkout
PLA Version
2.3.11
Current Behavior
While editing an entry that has a member (or uniqueMember) attribute, closing any dialog that uses the shared #page-modal (Export, Delete confirmation, the "... more values" viewer, etc) silently corrupts the member values in the edit form: the first member input is blanked and the remaining member rows are removed from the DOM.
Expected Behavior
Only closing the member-manage dialog should trigger the member write-back. Other dialogs must not touch the member inputs.
Steps To Reproduce
- Open a
groupOfNames entry, click Edit Entry
- Open the Export dialog (or click "N more values" on the member attribute) and close it again
- Observe the member rows in the form: first one blank, others gone
- Submitting now removes members that were never touched
Relevant log output
Anything else?
Root cause in resources/views/components/attribute/widget/options.blade.php (Member case): the hide.bs.modal handler is bound to the shared #page-modal and runs unconditionally:
$('#page-modal').on('hide.bs.modal',function() {
var updated = modal_update(modal_attr,attribute_values('destination','select','option'));
...
When any other dialog closes, select#destination doesn't exist, so attribute_values(...) returns [] and modal_update() executes its "all members removed" path against the form.
Fix (see PR): bail out unless the closing modal actually contains the member dialog:
if (! $(this).find('select#destination').length)
return;
Please note that for the creation of this Report, and for the creation of patches, I took Claude Cowork (using Fable 5) to my help. However: Bug finding, testing, refining results, re-testing and confirming working patch on a local instance have been all made by hand. I will file 2 other bugs and then the pull request.
Is there an existing issue for this?
Environment
PLA Code
Github checkout
PLA Version
2.3.11
Current Behavior
While editing an entry that has a
member(oruniqueMember) attribute, closing any dialog that uses the shared#page-modal(Export, Delete confirmation, the "... more values" viewer, etc) silently corrupts the member values in the edit form: the first member input is blanked and the remaining member rows are removed from the DOM.Expected Behavior
Only closing the member-manage dialog should trigger the member write-back. Other dialogs must not touch the member inputs.
Steps To Reproduce
groupOfNamesentry, click Edit EntryRelevant log output
Anything else?
Root cause in
resources/views/components/attribute/widget/options.blade.php(Member case): thehide.bs.modalhandler is bound to the shared#page-modaland runs unconditionally:When any other dialog closes,
select#destinationdoesn't exist, soattribute_values(...)returns[]andmodal_update()executes its "all members removed" path against the form.Fix (see PR): bail out unless the closing modal actually contains the member dialog:
Please note that for the creation of this Report, and for the creation of patches, I took Claude Cowork (using Fable 5) to my help. However: Bug finding, testing, refining results, re-testing and confirming working patch on a local instance have been all made by hand. I will file 2 other bugs and then the pull request.