To recreate: 1 - Create or edit a borrower with info in Sort1 and Sort2 field, not mapped to authorized values 2 - Note this info does not display on moremember.tt
Created attachment 62859 [details] [review] Bug 18512 - GetAuthorisedValues.GetByCode Template plguin should return code (not empty string) if value not found To test: 1 - Create or edit a borrower with info in Sort1 and Sort2 field, not mapped to authorized values 2 - Note this info does not display on moremember.tt 3 - Apply patch 4 - Note value is passed through
Created attachment 62893 [details] [review] Bug 18512 - GetAuthorisedValues.GetByCode Template plguin should return code (not empty string) if value not found To test: 1 - Create or edit a borrower with info in Sort1 and Sort2 field, not mapped to authorized values 2 - Note this info does not display on moremember.tt 3 - Apply patch 4 - Note value is passed through Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Hard to say... Indeed, bug 16908 modified the behaviour, but with this patch you are going to modify the behaviour for all other AuthorisedValues.GetByCode calls. Bug 16908 did not modify the behaviour of GetByCode.
I did a git grep on 'GetByCode' - I didn't see anything that would break on the code - it will just add to the display for anything unmapped so helps root out old data and cruft that has been hidden
Created attachment 62988 [details] [review] Bug 18512 - GetAuthorisedValues.GetByCode Template plguin should return code (not empty string) if value not found To test: 1 - Create or edit a borrower with info in Sort1 and Sort2 field, not mapped to authorized values 2 - Note this info does not display on moremember.tt 3 - Apply patch 4 - Note value is passed through Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 62989 [details] [review] Bug 18512: Add tests Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
*** Bug 18180 has been marked as a duplicate of this bug. ***
Pushed to master for 17.05, thanks Nick, Jonathan!
Tests don't pass applied on 16.11.x - not pushing this, please check. Test Summary Report ------------------- t/db_dependent/Template/Plugin/AuthorisedValues.t (Wstat: 65280 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 255
Created attachment 63714 [details] [review] Bug 18512: Add tests 16.11.X version Remove use of build_object Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(In reply to Katrin Fischer from comment #10) > Tests don't pass applied on 16.11.x - not pushing this, please check. > Test Summary Report > ------------------- > t/db_dependent/Template/Plugin/AuthorisedValues.t (Wstat: 65280 Tests: 1 > Failed: 1) > Failed test: 1 > Non-zero exit status: 255 Tests were using build_object which doesn't seem to be in 16.11.X New tests attached
Thx Nick! These patches have been pushed to 16.11.x and will be in 16.11.09.
Pushed to 16.05.x, for 16.05.15 release