Bug 23383

Summary: IdRef link appears even with syspref is off
Product: Koha Reporter: Fridolin Somers <fridolin.somers>
Component: OPACAssignee: Fridolin Somers <fridolin.somers>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: 1joynelson, bgkriegel, hayleypelham, lucas, martin.renvoize
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.05, 19.05.10
Bug Depends on: 8992    
Bug Blocks:    
Attachments: Bug 23383: fix IdRef syspref test in XSLT
Bug 23383: fix IdRef syspref test in XSLT
Bug 23383: fix IdRef syspref test in XSLT

Description Fridolin Somers 2019-07-26 13:29:04 UTC
IdRef link is displayed via XSLT.
There is a test of syspref with just if value is defined.
But in installer/data/mysql/sysprefs.sql you see this pref will be 0 by default, which is true in XPATH.
We should test that pref is 1.
Comment 1 Fridolin Somers 2019-07-26 13:50:16 UTC
Created attachment 91812 [details] [review]
Bug 23383: fix IdRef syspref test in XSLT

IdRef link is displayed via XSLT.
There is a test of syspref with just if value is defined.
But in installer/data/mysql/sysprefs.sql you see this pref will be 0 by default, which is true in XPATH.
We should test that pref is 1.

Test plan :
1) Create a fresh UNIMARC database
2) You have pref IdRef disabled
3) Simulate a SUDOC record:
  Fill a 7..$3 field with a ppn (032581270 for example).
  Fill the 009 field with an integer
4) Go to the opac detail page of the record => You don't see IdRef link
5) Enable IdRef syspref
6) Go to the opac detail page of the record => You see IdRef link
7) Disable IdRef syspref
8) Go to the opac detail page of the record => You don't see IdRef link
Comment 2 Bernardo Gonzalez Kriegel 2020-02-07 17:33:12 UTC
Hi, testing this.
Patch is simple and syntactically correct.

What framework are you using?
With english or unimarc_complete (fr-FR) field 009 is hidden.
Are you using another one?
Comment 3 Martin Renvoize 2020-03-09 09:48:28 UTC
Created attachment 100329 [details] [review]
Bug 23383: fix IdRef syspref test in XSLT

IdRef link is displayed via XSLT.
There is a test of syspref with just if value is defined.
But in installer/data/mysql/sysprefs.sql you see this pref will be 0 by default, which is true in XPATH.
We should test that pref is 1.

Test plan :
1) Create a fresh UNIMARC database
2) You have pref IdRef disabled
3) Simulate a SUDOC record:
  Fill a 7..$3 field with a ppn (032581270 for example).
  Fill the 009 field with an integer
4) Go to the opac detail page of the record => You don't see IdRef link
5) Enable IdRef syspref
6) Go to the opac detail page of the record => You see IdRef link
7) Disable IdRef syspref
8) Go to the opac detail page of the record => You don't see IdRef link

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize 2020-03-09 09:50:15 UTC
Nice catch Fridolin,

Code scans well and I believe would do as expected.  I agree, looking at the code Bernardo's point makes sense.. I don't have  Unimarc test set here so haven't directly tested but I can't see that though would cause a negative regression so am signing off anyway to let it move forward.
Comment 5 Jonathan Druart 2020-03-11 16:36:26 UTC
Created attachment 100588 [details] [review]
Bug 23383: fix IdRef syspref test in XSLT

IdRef link is displayed via XSLT.
There is a test of syspref with just if value is defined.
But in installer/data/mysql/sysprefs.sql you see this pref will be 0 by default, which is true in XPATH.
We should test that pref is 1.

Test plan :
1) Create a fresh UNIMARC database
2) You have pref IdRef disabled
3) Simulate a SUDOC record:
  Fill a 7..$3 field with a ppn (032581270 for example).
  Fill the 009 field with an integer
4) Go to the opac detail page of the record => You don't see IdRef link
5) Enable IdRef syspref
6) Go to the opac detail page of the record => You see IdRef link
7) Disable IdRef syspref
8) Go to the opac detail page of the record => You don't see IdRef link

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 6 Martin Renvoize 2020-03-16 11:03:10 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 7 Joy Nelson 2020-04-03 17:24:49 UTC
Backported to 19.11.x branch for 19.11.05
Comment 8 Lucas Gass 2020-04-10 15:47:40 UTC
backported to 19.05.x for 19.05.10
Comment 9 Hayley Pelham 2020-04-20 00:01:10 UTC
Minor/normal patch will not be backported to 18.11.x series