Bug 14453

Summary: kohaidx is missing for id in authority-koha-indexdefs.xml
Product: Koha Reporter: Fridolin Somers <fridolin.somers>
Component: SearchingAssignee: Fridolin Somers <fridolin.somers>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: chris, katrin.fischer, kyle, liz, mirko, mtj, tomascohen
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:
Bug Depends on:    
Bug Blocks: 14217    
Attachments: Bug 14453 - kohaidx is missing for id in authority-koha-indexdefs.xml
Bug 14453 - kohaidx is missing for id in authority-koha-indexdefs.xml
[SIGNED OFF] Bug 14453: kohaidx is missing for id in authority-koha-indexdefs.xml
Bug 14453 Followup: fix standard file
[SIGNED OFF] Bug 14453: (followup) Fix shipped XSLT files
[PASSED QA] Bug 14453: kohaidx is missing for id in authority-koha-indexdefs.xml
[PASSED QA] Bug 14453: (followup) Fix shipped XSLT files

Description Fridolin Somers 2015-06-24 14:05:13 UTC
In authority-koha-indexdefs.xml, all tags use the namespace "kohaidx" except the tag "id".

When re-generating authority-zebra-indexdefs.xsl, the line :
  <xslo:variable name="idfield" select="normalize-space(marc:controlfield[@tag='001'])"/>
is modified :
  <xslo:variable name="idfield" select="normalize-space()"/>
This is an error.
Comment 1 Fridolin Somers 2015-06-24 14:11:24 UTC Comment hidden (obsolete)
Comment 2 Mirko Tietgen 2015-06-25 09:44:13 UTC Comment hidden (obsolete)
Comment 3 Mirko Tietgen 2015-06-25 09:44:51 UTC
Before the patch

/usr/bin/xsltproc /home/mirko/koha/etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl authority-koha-indexdefs.xml > authority-zebra-indexdefs.xsl.bug14453

diff authority-zebra-indexdefs.xsl authority-zebra-indexdefs.xsl.bug14453
 
14a15
>   <xslo:template match="text()" mode="index_facets"/>
30c31
<     <xslo:variable name="idfield" select="normalize-space(marc:controlfield[@tag='001'])"/>
---
>     <xslo:variable name="idfield" select="normalize-space()"/>
37a39
>       <xslo:apply-templates mode="index_facets"/>



After the patch

/usr/bin/xsltproc /home/mirko/koha/etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl authority-koha-indexdefs.xml > authority-zebra-indexdefs.xsl.bug14453patched

diff authority-zebra-indexdefs.xsl authority-zebra-indexdefs.xsl.bug14453patched 

14a15
>   <xslo:template match="text()" mode="index_facets"/>
37a39
>       <xslo:apply-templates mode="index_facets"/>


The patch fixes the problem in the description.

There seem to be two other differences between the standard file and the generated output?
Comment 4 Fridolin Somers 2015-06-25 12:55:42 UTC
(In reply to Mirko Tietgen from comment #3)
> There seem to be two other differences between the standard file and the
> generated output?

Yes indeed, but since its not the purpose of this bugfix I've not added this in the patch.
Since authorities does not use facets, this call is useless.

Thanks for testing :)
Comment 5 Tomás Cohen Arazi 2015-06-25 13:01:12 UTC
(In reply to Mirko Tietgen from comment #3)
> There seem to be two other differences between the standard file and the
> generated output?

Those templates will never be applied to authority records as we don't have facets defined for authorities. I tried myself (to make sure) and the templates in the generated XSLT work as expected.
Comment 6 Tomás Cohen Arazi 2015-06-25 13:17:46 UTC Comment hidden (obsolete)
Comment 7 Fridolin Somers 2015-06-25 13:29:13 UTC
(In reply to Tomás Cohen Arazi from comment #6)
> As Mirko mentioned, the xslt's now generate the facet-processing templates in
> the authority xslt's too. They are harmless because we don't define facets
> for authority records. If we did, it would be harmless too.

I think it would be cool to commit the correct generated files, in order to avoid having this surprise at first generation ;)
Comment 8 Mirko Tietgen 2015-06-25 13:31:50 UTC
I agree. If it is what you get from a generation, the standard file should have it too.
Comment 9 Mirko Tietgen 2015-06-25 13:39:43 UTC Comment hidden (obsolete)
Comment 10 Mirko Tietgen 2015-06-25 13:40:19 UTC
Added a followup for that.
Comment 11 Fridolin Somers 2015-06-25 14:18:41 UTC
(In reply to Mirko Tietgen from comment #10)
> Added a followup for that.
Can you add the same change for UNIMARC ?
I'll sign them
Comment 12 Tomás Cohen Arazi 2015-06-25 15:09:39 UTC Comment hidden (obsolete)
Comment 13 Kyle M Hall 2015-07-08 16:23:11 UTC
Created attachment 40838 [details] [review]
[PASSED QA] Bug 14453: kohaidx is missing for id in authority-koha-indexdefs.xml

In authority-koha-indexdefs.xml, all tags use the namespace "kohaidx" except the tag "id".

When re-generating authority-zebra-indexdefs.xsl, the line :
  <xslo:variable name="idfield" select="normalize-space(marc:controlfield[@tag='001'])"/>
is modified :
  <xslo:variable name="idfield" select="normalize-space()"/>
This is an error.

This patch adds kohaidx namespace to correct.

Test plan :
- Without patch
- go to etc/zebradb/marc_defs/marc21/authorities/
- run : xslproc xsltproc ../../../xsl/koha-indexdefs-to-zebra.xsl authority-koha-indexdefs.xml > authority-zebra-indexdefs.xsl
- read authority-zebra-indexdefs.xsl
=> the line has changed : <xslo:variable name="idfield" select="normalize-space()"/>
- Apply patch
- go to etc/zebradb/marc_defs/marc21/authorities/
- run : xslproc xsltproc ../../../xsl/koha-indexdefs-to-zebra.xsl authority-koha-indexdefs.xml > authority-zebra-indexdefs.xsl
- read authority-zebra-indexdefs.xsl
=> the line has not changed
(same for unimarc flavor)

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
As Mirko mentioned, the xslt's now generate the facet-processing templates in
the authority xslt's too. They are harmless because we don't define facets
for authority records. If we did, it would be harmless too.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 14 Kyle M Hall 2015-07-08 16:23:17 UTC
Created attachment 40839 [details] [review]
[PASSED QA] Bug 14453: (followup) Fix shipped XSLT files

Make the shipped XSLTs for authorities (MARC21 and UNIMARC) the same as the generated version

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 15 Tomás Cohen Arazi 2015-07-08 17:42:45 UTC
Patches pushed to master.

Good catch Frido!
Comment 16 Chris Cormack 2015-07-14 08:49:27 UTC
Pushed to 3.20.x will be in 3.20.2
Comment 17 Liz Rea 2015-07-20 22:16:17 UTC
Pushed to 3.18.x will be in 3.18.09
Comment 18 Mason James 2015-07-25 13:10:57 UTC
Pushed to 3.16.x, will be in 3.16.13