[Bug 42161] New: Non-mandatory patron attribute type does not appear in members-update.pl
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42161 Bug ID: 42161 Summary: Non-mandatory patron attribute type does not appear in members-update.pl Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: aude.charillon@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle@bywatersolutions.com Modifying a non-mandatory patron attribute type in the OPAC is not taken into account in the Update patron records page in the staff interface, when the field was blank at the point of self-registration and has never been updated in the staff interface. To replicate: 1. Create a mandatory patron attribute type: go to Administration > Patron attribute types > New. For example, give it code NEWS and description 'Receive newsletter?' Tick: Display in OPAC, Editable in OPAC, OPAC mandatory. 2. Create a non-mandatory patron attribute type: go to Administration > Patron attribute types > New. For example, give it code SUPREQ and description 'Support requirements'. Tick: Display in OPAC, Editable in OPAC. 3. Set up self-registration: set the PatronSelfRegistration system preference to 'Allow'. 4. Make sure PatronSelfRegistrationDefaultCategory is filled with a patron category. 5. Set the OPACPatronDetails system preference to 'Allow'. 6. Go to the OPAC > Create an account (opac-memberentry.pl) and add some details. Under Additional information, enter a value for 'Receive newsletter?' but leave 'Support requirements' blank. Submit. 7. Login to the OPAC with your newly-registered patron. 8. In the personal details tab, add a value solely for 'Support requirements'. Submit update request. 9. From the staff interface homepage, click Patrons requesting modifications (members-update.pl). 10. A request for the patron created in step 6 appears, with a section entitled Additional attributes and identifiers. There is one row Field = Newsletter; old value and new value are the same. Note that we did not update Newsletter in step 8; this row should not appear. Note that we added a value for Support requirements in step 8: this does not appear; this is the bug being reported. 11. Approve the update request: tick Approve then click Submit. 12. In the staff interface, go to the patron acccount. Note that the Support requirements field is still empty. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42161 --- Comment #1 from Aude Charillon <aude.charillon@openfifth.co.uk> --- I also tested: A. Updating the mandatory patron attribute: this works. B. Updating both the mandatory and non-mandatory attribute: only the mandatory is taken into account in steps 10-12. C. Updating the non-mandatory patron attribute in the staff interface: the value correctly appears in the OPAC. Repeating steps 8 to 12: this time, the updated value does correctly display at step 10 in members-update.pl and at step 12 in the patron record. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42161 lucy.farnsworth@nhs.net changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucy.farnsworth@nhs.net -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42161 --- Comment #2 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 199331 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199331&action=edit Bug 42161: Fix identify_updated_extended_attributes for patrons with no prior attributes Two bugs in identify_updated_extended_attributes caused OPAC patron attribute updates to be silently lost: 1. $patron_attribute_types and $passed_attribute_types were declared as undef rather than empty hashrefs. When a patron had zero existing opac_editable attributes, `keys %{undef}` raised a fatal error, swallowing the modification request entirely. 2. The `any` check when comparing values did not filter by attribute code. If any other submitted attribute happened to share the same value as the existing value being tested (e.g. two empty-string attributes), the change was incorrectly treated as a no-op. Adds two new test cases covering both failure modes. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42161 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |martin.renvoize@openfifth.c |ity.org |o.uk Severity|enhancement |normal CC| |martin.renvoize@openfifth.c | |o.uk -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42161 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42161 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Sponsorship status|--- |Sponsored Patch complexity|--- |Trivial patch Comma delimited| |OpenFifth list of Sponsors| |<https://openfifth.co.uk/> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42161 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199331|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42161 --- Comment #3 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 199332 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199332&action=edit Bug 42161: Fix identify_updated_extended_attributes for patrons with no prior attributes Two bugs in identify_updated_extended_attributes caused OPAC patron attribute updates to be silently lost: 1. $patron_attribute_types and $passed_attribute_types were declared as undef rather than empty hashrefs. When a patron had zero existing opac_editable attributes, `keys %{undef}` raised a fatal error, swallowing the modification request entirely. 2. The `any` check when comparing values did not filter by attribute code. If any other submitted attribute happened to share the same value as the existing value being tested (e.g. two empty-string attributes), the change was incorrectly treated as a no-op. Adds two new test cases covering both failure modes. Sponsored-by: OpenFifth <https://openfifth.co.uk/> -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org