To recreate: 1 - Create a new patron attribute - check boxes to make it mandatory and visible etc. 2 - Limit it to 'Patron' or other category 3 - Edit a patron not in that category 4 - Attempt to save 5 - 500 Error 6 - Missing mandatory extended attribute (type=MAND)
Created attachment 136454 [details] [review] Bug 31005: Unit test
Created attachment 136455 [details] [review] Bug 31005: Don't inlcude attributes only required for other categories To test: 1 - Create a new patron attribute - check boxes to make it mandatory and visible etc. 2 - Limit it to 'Patron' or other category 3 - Edit a patron not in that category 4 - Attempt to save 5 - 500 Error 6 - Missing mandatory extended attribute (type=MAND) 7 - Apply patch 8 - Attempt aedit again 9 - It succeeds! 10 - Edit a patron in the category with MAND required 11 - on the edit page, right click teh attribute - click 'delete node' 12 - Submit the form 13 - 500 error, but this time that's good, the attribute check works
Created attachment 136499 [details] [review] Bug 31005: Unit test Signed-off-by: David Nind <david@davidnind.com>
Created attachment 136500 [details] [review] Bug 31005: Don't inlcude attributes only required for other categories To test: 1 - Create a new patron attribute - check boxes to make it mandatory and visible etc. 2 - Limit it to 'Patron' or other category 3 - Edit a patron not in that category 4 - Attempt to save 5 - 500 Error 6 - Missing mandatory extended attribute (type=MAND) 7 - Apply patch 8 - Attempt aedit again 9 - It succeeds! 10 - Edit a patron in the category with MAND required 11 - on the edit page, right click teh attribute - click 'delete node' 12 - Submit the form 13 - 500 error, but this time that's good, the attribute check works Signed-off-by: David Nind <david@davidnind.com>
Testing notes (using koha-testing-docker): 1. Tests pass: prove t/db_dependent/Koha/Patron.t 2. For step 11: in Firefox enable the web developer tools, select the input field for the attribute, then right click the HTML for the input field in the inspector window and select delete node,
Created attachment 136501 [details] [review] Bug 31005: Unit test Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 136502 [details] [review] Bug 31005: Don't inlcude attributes only required for other categories To test: 1 - Create a new patron attribute - check boxes to make it mandatory and visible etc. 2 - Limit it to 'Patron' or other category 3 - Edit a patron not in that category 4 - Attempt to save 5 - 500 Error 6 - Missing mandatory extended attribute (type=MAND) 7 - Apply patch 8 - Attempt aedit again 9 - It succeeds! 10 - Edit a patron in the category with MAND required 11 - on the edit page, right click teh attribute - click 'delete node' 12 - Submit the form 13 - 500 error, but this time that's good, the attribute check works Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Good catch, simple fix. Unit tests included and passing Passing QA
Pushed to master for 22.11. Nice work everyone, thanks!
Backported to 22.05.x for 22.05.01
backported to 21.11.x for 21.11.10, thx!
Backported: Pushed to 21.05.x branch for 21.05.17 Nothing to document, marking resolved.