Bug 23383 - IdRef link appears even with syspref is off
Summary: IdRef link appears even with syspref is off
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Fridolin SOMERS
QA Contact: Testopia
URL:
Keywords:
Depends on: 8992
Blocks:
  Show dependency treegraph
 
Reported: 2019-07-26 13:29 UTC by Fridolin SOMERS
Modified: 2020-04-20 00:01 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.05, 19.05.10


Attachments
Bug 23383: fix IdRef syspref test in XSLT (1.59 KB, patch)
2019-07-26 13:50 UTC, Fridolin SOMERS
Details | Diff | Splinter Review
Bug 23383: fix IdRef syspref test in XSLT (1.65 KB, patch)
2020-03-09 09:48 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 23383: fix IdRef syspref test in XSLT (1.73 KB, patch)
2020-03-11 16:36 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 Mapley 2020-04-20 00:01:10 UTC
Minor/normal patch will not be backported to 18.11.x series