[Bug 31364] New: Saving preferences with a dropdown with check boxes doesn't save in the case where all the checks are removed.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31364 Bug ID: 31364 Summary: Saving preferences with a dropdown with check boxes doesn't save in the case where all the checks are removed. Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: System Administration Assignee: koha-bugs@lists.koha-community.org Reporter: rkuiper@roundrocktexas.gov QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com When updating a system preference with a dropdown that contains checkboxes, the changes are not saved in the case where there were items checked and then you try to remove all checks. An example of this is OPACHoldsIfAvailableAtPickupExceptions. Set a couple patron categories as exceptions. Save. Remove all the categories from the exception list. Save. You get a message that says 'Nothing to Save' and the changes are not made. -- 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=31364 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |major -- 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=31364 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #1 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- *** Bug 31474 has been marked as a duplicate of this bug. *** -- 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=31364 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=31333 -- 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=31364 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com --- Comment #2 from Lucas Gass <lucas@bywatersolutions.com> --- In preferences.js, if we are dealing with multiple select type system preference we check to make sure the value is not NULL before pushing anything to the unserialized array. I think we should allow for that value to be empty/null. -- 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=31364 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- 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=31364 --- Comment #3 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 140064 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=140064&action=edit Bug 31364: Allow multiple select system prefernces to saved when they are empty/null TO test: 1. Have a multiple select system preference like 'OPACHoldsIfAvailableAtPickupExceptions'. 2. Set a couple patron categories as exceptions and save. 3. Remove all the categories from the exception list and save. 4. You get a message that says 'Nothing to Save' and the changes are not made. 5. Apply patch 6. Try 2-4 again, excpet this time it should save. -- 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=31364 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Version|unspecified |master Assignee|koha-bugs@lists.koha-commun |lucas@bywatersolutions.com |ity.org | -- 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=31364 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31364 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #140064|0 |1 is obsolete| | --- Comment #4 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 140102 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=140102&action=edit Bug 31364: Allow multiple select system prefernces to saved when they are empty/null TO test: 1. Have a multiple select system preference like 'OPACHoldsIfAvailableAtPickupExceptions'. 2. Set a couple patron categories as exceptions and save. 3. Remove all the categories from the exception list and save. 4. You get a message that says 'Nothing to Save' and the changes are not made. 5. Apply patch 6. Try 2-4 again, excpet this time it should save. Signed-off-by: Owen Leonard <oleonard@myacpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31364 Joonas Kylmälä <joonas.kylmala@iki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA CC| |joonas.kylmala@iki.fi --- Comment #5 from Joonas Kylmälä <joonas.kylmala@iki.fi> --- Adds a comma in the end of the syspref list due to it sending an empty sysref value in addition to filled ones in the query string:
MariaDB [koha_kohadev]> select * from systempreferences where variable = "OPACHoldsIfAvailableAtPickupExceptions"\G *************************** 1. row *************************** variable: OPACHoldsIfAvailableAtPickupExceptions value: B,HB, options: explanation: List the patron categories not affected by OPACHoldsIfAvailableAtPickup if off type: Free
Since the sysref object value is an array we can just check instead whether the array is empty. Will send a patch shortly -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31364 Joonas Kylmälä <joonas.kylmala@iki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31364 Joonas Kylmälä <joonas.kylmala@iki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #140102|0 |1 is obsolete| | --- Comment #6 from Joonas Kylmälä <joonas.kylmala@iki.fi> --- Created attachment 140201 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=140201&action=edit Bug 31364: Check length of the multiple syspref array instead whether it is null The multiple systempreferences are always defined as an empty array at the minimum, so in order to determine whether we need to remove all the selections from the systempreference we should check whether the array is empty and not whether the array doesn't exist. To test: 1) Set at least 1 value for OPACHoldsIfAvailableAtPickupExceptions 2) Remove all the values for OPACHoldsIfAvailableAtPickupExceptions and notice you get the message "Nothing to save" 3) Apply patch and repeat, removing all the values should work now. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31364 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31364 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #140201|0 |1 is obsolete| | --- Comment #7 from David Nind <david@davidnind.com> --- Created attachment 140220 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=140220&action=edit Bug 31364: Check length of the multiple syspref array instead whether it is null The multiple systempreferences are always defined as an empty array at the minimum, so in order to determine whether we need to remove all the selections from the systempreference we should check whether the array is empty and not whether the array doesn't exist. To test: 1) Set at least 1 value for OPACHoldsIfAvailableAtPickupExceptions 2) Remove all the values for OPACHoldsIfAvailableAtPickupExceptions and notice you get the message "Nothing to save" 3) Apply patch and repeat, removing all the values should work now. Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31364 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aleisha@catalyst.net.nz --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- *** Bug 31524 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31364 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |katrin.fischer@bsz-bw.de |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31364 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31364 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #140220|0 |1 is obsolete| | --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 140269 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=140269&action=edit Bug 31364: Check length of the multiple syspref array instead whether it is null The multiple systempreferences are always defined as an empty array at the minimum, so in order to determine whether we need to remove all the selections from the systempreference we should check whether the array is empty and not whether the array doesn't exist. To test: 1) Set at least 1 value for OPACHoldsIfAvailableAtPickupExceptions 2) Remove all the values for OPACHoldsIfAvailableAtPickupExceptions and notice you get the message "Nothing to save" 3) Apply patch and repeat, removing all the values should work now. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31364 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Saving preferences with a |Saving multi-select system |dropdown with check boxes |preference don't save when |doesn't save in the case |all checks are removed |where all the checks are | |removed. | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31364 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|lucas@bywatersolutions.com |joonas.kylmala@iki.fi -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31364 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |22.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31364 --- Comment #10 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 22.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31364 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable Version(s)|22.11.00 |22.11.00, 22.05.07 released in| | --- Comment #11 from Lucas Gass <lucas@bywatersolutions.com> --- Backported to 22.05.x for upcoming 22.05.07 release -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31364 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |arthur.suzuki@biblibre.com Version(s)|22.11.00, 22.05.07 |22.11.00, 22.05.07, released in| |21.11.14 Status|Pushed to stable |Pushed to oldstable --- Comment #12 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- applied to 21.11.x for 21.11.14 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31364 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to oldstable |RESOLVED CC| |victor@tuxayo.net --- Comment #13 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Doesn't affect 21.05.x, not backported. Nothing to document, marking resolved. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31364 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|22.11.00, 22.05.07, |22.11.00, 22.05.07 released in|21.11.14 | --- Comment #14 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- revert on 21.11, bug not reproduced -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org