Summary: | branchcode in BorrowerUnwantedField causes software error when saving patron record | ||
---|---|---|---|
Product: | Koha | Reporter: | Barton Chittenden <barton> |
Component: | Patrons | Assignee: | Nick Clemens (kidclamp) <nick> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | andrewfh, caroline.cyr-la-rose, david, fridolin.somers, gmcharlt, jonathan.druart, katrin.fischer, kyle.m.hall, liz, lucas, nengard, nick |
Version: | Main | Keywords: | Manual |
Hardware: | All | ||
OS: | All | ||
See Also: |
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16865 https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25029 |
||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: |
A more user friendly interface for selecting database columns for some system preferences (such as BorrowerUnwantedField) was added in Koha 20.11 (Bug 22844).
Some database columns should be excluded from selection as they can cause server errors. For example, branchcode in BorrowerUnwantedField is required for adding patrons - if selected it causes a server error and you can't add a patron, so it should not be selectable.
This bug fixes the issue by:
- allowing developers to define the database columns to exclude from selection in the .pref system preference definition file using "exclusions: "
- disabling the selection of the excluded database columns in the staff interface when configuring system preferences that allow selecting database columns
- updating the BorrowerUnwantedField system preference to exclude branchcode
|
Version(s) released in: |
21.05.00,20.11.03
|
Bug Depends on: | 22844 | ||
Bug Blocks: | 27261 | ||
Attachments: |
Bug 17364: Add ability to exclude some columns from selection for system preferences
Bug 17364: Add ability to exclude some columns from selection for system preferences Bug 17364: (follow-up) Add missing filter Bug 17364: (follow-up) Do not check excluded fields Bug 17364: Add ability to exclude some columns from selection for system preferences Bug 17364: (follow-up) Add missing filter Bug 17364: (follow-up) Do not check excluded fields Bug 17364: (follow-up) Do not check excluded fields Bug 17364: Add ability to exclude some columns from selection for system preferences Bug 17364: (follow-up) Add missing filter Bug 17364: (follow-up) Do not check excluded fields |
Description
Barton Chittenden
2016-09-27 20:42:45 UTC
Created attachment 113238 [details] [review] Bug 17364: Add ability to exclude some columns from selection for system preferences Bug 22844 Added the option to provide a modal for selecting database columns for system preferences Some system preferences are limited to a subset of the columns allowed. For instance, setting branchcode in BorrowerUnwantedFields prevents adding new patrons This patch allows for defining exclusions in the .pref file To test: 1 - Alter BorroweUnwantedFields and select branchcode 2 - Attempt to add a new patron 3 - Get a message like "Something went wrong. Check the logs" 4 - Apply patches 5 - Alter the preference again 6 - Note that branchcode is unchecked and disabled 7 - Save the pref 8 - Add a patron 9 - It succeeds Created attachment 113239 [details] [review] Bug 17364: Add ability to exclude some columns from selection for system preferences Bug 22844 Added the option to provide a modal for selecting database columns for system preferences Some system preferences are limited to a subset of the columns allowed. For instance, setting branchcode in BorrowerUnwantedFields prevents adding new patrons This patch allows for defining exclusions in the .pref file To test: 1 - Alter BorroweUnwantedFields and select branchcode 2 - Attempt to add a new patron 3 - Get a message like "Something went wrong. Check the logs" 4 - Apply patches 5 - Alter the preference again 6 - Note that branchcode is unchecked and disabled 7 - Save the pref 8 - Add a patron 9 - It succeeds Patch works well :D But : There is a missing html filter in : data-exclusions="[% CHUNK.exclusions %] Most important : Clicking on "Select all" selects the branchcode :O Created attachment 114409 [details] [review] Bug 17364: (follow-up) Add missing filter (In reply to Fridolin Somers from comment #3) > > Most important : > Clicking on "Select all" selects the branchcode :O Do you reproduce this ? Its a major issue no ? (In reply to Fridolin Somers from comment #5) > (In reply to Fridolin Somers from comment #3) > > > > Most important : > > Clicking on "Select all" selects the branchcode :O > > Do you reproduce this ? > Its a major issue no ? I cannot reproduce this. When I click 'Select All' the branchcode option does appear to be select (it gets a check) but if I load the registration form I am able to complete it. Also if I click 'Select All' and save then immediately reopen the modal you will see that branchcode is not selected. Can we do the same for PatronSelfRegistrationBorrowerUnwantedField? With all the hard work Nick did it would not be easy to add easily add the 'exclusions: branchcode' line to opac.pref now (In reply to Lucas Gass from comment #7) > Can we do the same for PatronSelfRegistrationBorrowerUnwantedField? With all > the hard work Nick did it would not be easy to add easily add the > 'exclusions: branchcode' line to opac.pref now it would be easy* (In reply to Lucas Gass from comment #6) > (In reply to Fridolin Somers from comment #5) > > (In reply to Fridolin Somers from comment #3) > > > > > > Most important : > > > Clicking on "Select all" selects the branchcode :O > > > > Do you reproduce this ? > > Its a major issue no ? > > I cannot reproduce this. When I click 'Select All' the branchcode option > does appear to be select (it gets a check) but if I load the registration > form I am able to complete it. Also if I click 'Select All' and save then > immediately reopen the modal you will see that branchcode is not selected. Indeed, disabled inputs are not posted in forms. But its very disturbing to see it checked in my opinion. I try to create a fix Created attachment 114470 [details] [review] Bug 17364: (follow-up) Do not check excluded fields When clicking on "Select all" excluded fields are selected. Even if they are not saved into preference, this is disturbing. Test plan : 1) Edit BorroweUnwantedFields system preference 2) Click "Select all" 3) See that branchcode is not selected Was easy ^^ Maybe we need some CSS on excluded fields name, grey color for example. Created attachment 114471 [details] [review] Bug 17364: Add ability to exclude some columns from selection for system preferences Bug 22844 Added the option to provide a modal for selecting database columns for system preferences Some system preferences are limited to a subset of the columns allowed. For instance, setting branchcode in BorrowerUnwantedFields prevents adding new patrons This patch allows for defining exclusions in the .pref file To test: 1 - Alter BorroweUnwantedFields and select branchcode 2 - Attempt to add a new patron 3 - Get a message like "Something went wrong. Check the logs" 4 - Apply patches 5 - Alter the preference again 6 - Note that branchcode is unchecked and disabled 7 - Save the pref 8 - Add a patron 9 - It succeeds Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Created attachment 114472 [details] [review] Bug 17364: (follow-up) Add missing filter Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Created attachment 114473 [details] [review] Bug 17364: (follow-up) Do not check excluded fields When clicking on "Select all" excluded fields are selected. Even if they are not saved into preference, this is disturbing. Test plan : 1) Edit BorroweUnwantedFields system preference 2) Click "Select all" 3) See that branchcode is not selected I signed 2 first patches, leaving NSO for my followup Created attachment 114475 [details] [review] Bug 17364: (follow-up) Do not check excluded fields When clicking on "Select all" excluded fields are selected. Even if they are not saved into preference, this is disturbing. Test plan : 1) Edit BorroweUnwantedFields system preference 2) Click "Select all" 3) See that branchcode is not selected Signed-off-by: Nick Clemens <nick@bywatersolutions.com> The option branchcode cannot be selected with this patch, but it's not visually clear. Could we make option appear greyed out or similar the GUI easier to understand? And would it not be easier to not show the option at all if it's not available for a specific preference? Please review! I found bug 27321 now - hope we can get a quick sign-off as this could solve the issue here! I've signed off bug 27321 Created attachment 116114 [details] [review] Bug 17364: Add ability to exclude some columns from selection for system preferences Bug 22844 Added the option to provide a modal for selecting database columns for system preferences Some system preferences are limited to a subset of the columns allowed. For instance, setting branchcode in BorrowerUnwantedFields prevents adding new patrons This patch allows for defining exclusions in the .pref file To test: 1 - Alter BorroweUnwantedFields and select branchcode 2 - Attempt to add a new patron 3 - Get a message like "Something went wrong. Check the logs" 4 - Apply patches 5 - Alter the preference again 6 - Note that branchcode is unchecked and disabled 7 - Save the pref 8 - Add a patron 9 - It succeeds Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 116115 [details] [review] Bug 17364: (follow-up) Add missing filter Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 116116 [details] [review] Bug 17364: (follow-up) Do not check excluded fields When clicking on "Select all" excluded fields are selected. Even if they are not saved into preference, this is disturbing. Test plan : 1) Edit BorroweUnwantedFields system preference 2) Click "Select all" 3) See that branchcode is not selected Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Pushed to master for 21.05, thanks to everybody involved! Pushed to 20.11.x for 20.11.03 Missing dependency, not backported to 20.05 *** Bug 16865 has been marked as a duplicate of this bug. *** |