Bug 18512 - GetAuthorisedValues.GetByCode Template plugin should return code (not empty string) if value not found
Summary: GetAuthorisedValues.GetByCode Template plugin should return code (not empty s...
Status: Pushed to Stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Nick Clemens
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
: 18180 (view as bug list)
Depends on: 16908
Blocks:
  Show dependency treegraph
 
Reported: 2017-04-28 18:09 UTC by Nick Clemens
Modified: 2017-07-31 11:07 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 18512 - GetAuthorisedValues.GetByCode Template plguin should return code (not empty string) if value not found (1023 bytes, patch)
2017-04-28 18:12 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 18512 - GetAuthorisedValues.GetByCode Template plguin should return code (not empty string) if value not found (1.05 KB, patch)
2017-04-29 01:43 UTC, M. Tompsett
Details | Diff | Splinter Review
Bug 18512 - GetAuthorisedValues.GetByCode Template plguin should return code (not empty string) if value not found (1.12 KB, patch)
2017-05-02 20:28 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 18512: Add tests (3.17 KB, patch)
2017-05-02 20:28 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 18512: Add tests 16.11.X version (3.33 KB, patch)
2017-05-25 13:02 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2017-04-28 18:09:35 UTC

    
Comment 1 Nick Clemens 2017-04-28 18:10:47 UTC
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
Comment 2 Nick Clemens 2017-04-28 18:12:08 UTC
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
Comment 3 M. Tompsett 2017-04-29 01:43:13 UTC
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>
Comment 4 Jonathan Druart 2017-05-02 16:26:12 UTC
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.
Comment 5 Nick Clemens 2017-05-02 17:20:57 UTC
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
Comment 6 Jonathan Druart 2017-05-02 20:28:36 UTC
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>
Comment 7 Jonathan Druart 2017-05-02 20:28:40 UTC
Created attachment 62989 [details] [review]
Bug 18512: Add tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 8 Jesse Maseto 2017-05-03 16:17:36 UTC
*** Bug 18180 has been marked as a duplicate of this bug. ***
Comment 9 Kyle M Hall 2017-05-08 12:38:25 UTC
Pushed to master for 17.05, thanks Nick, Jonathan!
Comment 10 Katrin Fischer 2017-05-13 12:44:32 UTC
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
Comment 11 Nick Clemens 2017-05-25 13:02:30 UTC
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>
Comment 12 Nick Clemens 2017-05-25 13:03:26 UTC
(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
Comment 13 Katrin Fischer 2017-06-05 13:31:09 UTC
Thx Nick!

These patches have been pushed to 16.11.x and will be in 16.11.09.
Comment 14 Mason James 2017-07-31 11:07:11 UTC
Pushed to 16.05.x, for 16.05.15 release