Bug 11004

Summary: Make xmlControlfield.js use the marcflavour syspref to look for XML files
Product: Koha Reporter: Magnus Enger <magnus>
Component: MARC Bibliographic data supportAssignee: Magnus Enger <magnus>
Status: CLOSED FIXED QA Contact: Jonathan Druart <jonathan.druart>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, gitbot, gmcharlt, jonathan.druart, mathsabypro
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on:    
Bug Blocks: 10997    
Attachments: Bug 11004 - Make xmlControlfield.js use the marcflavour syspref to look for XML files
Bug 11004 - Make xmlControlfield.js use the marcflavour syspref to look for XML files
Bug 11004 - Make xmlControlfield.js use the marcflavour syspref to look for XML files

Description Magnus Enger 2013-10-07 12:58:52 UTC
On line 208, xmlControlfield.js is hardcoded to look for MARC21 XML files: 

  url: this.themelang + "/data/marc21_field_" + this.tagfield + ".xml",

In order to fix Bug 10997 I will need this JS to use the value of the marcflavour syspref.
Comment 1 Magnus Enger 2013-10-07 13:26:51 UTC Comment hidden (obsolete)
Comment 2 Mathieu Saby 2013-10-07 14:41:10 UTC
Maybe we could use the xml files for unimarc latter. I did not realized before that value builders were not build the same way in different marc flavor...

M. Saby
Comment 3 I'm just a bot 2013-10-28 06:26:18 UTC
Patch applied cleanly, go forth and signoff
Comment 4 Chris Cormack 2013-12-23 22:24:48 UTC Comment hidden (obsolete)
Comment 5 Jonathan Druart 2013-12-24 10:50:34 UTC
I am not sure to understand the patch: if marcflavour is NORMARC, normally 006 and 008 should not be linked to a plugin.

Since it works as described and I have confidence in Magnus, I mark it as Passed QA.
Comment 6 Jonathan Druart 2013-12-24 10:51:04 UTC
Created attachment 23806 [details] [review]
Bug 11004 - Make xmlControlfield.js use the marcflavour syspref to look for XML files

Currently, xmlControlfield.js is hard coded to look for XML files for MARC21:

  url: this.themelang + "/data/marc21_field_" + this.tagfield + ".xml",

This patch makes this code use the value from the marcflavour syspref, as a
preparation for making the NORMARC value builders use the XML technique
employed by the MARC21 value builders for 006 and 008.

To test:
- Make sure you have a MARC21 installation
- Set marcflavour = NORMARC
- Go to Cataloguing and start a new record with the default framework
- Open the value builders for 006 and 008 and observe that they still work, showing
  the coded values for MARC21
- Apply this patch
- Check the value builders for 006 and 008 and observe that you get a truncated view
  with an empty "Select a type of material" dropdown
- Use e.g. the Net console in Firebug to observe requests to
  http://localhost/intranet-tmpl/prog/en/data/normarc_field_008.xml
  that result in a 404 status
- Set marcflavour = MARC21
- Observe that the value builders for 006 and 008 are now fully working
- 006 and 008 should be the only value builders affected by this change, since
  they are the only ones using xmlControlfield.js, but please also verify that
  other value builders are still working as expected

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 7 Galen Charlton 2013-12-25 16:06:54 UTC
Pushed to master.  Thanks, Magnus!
Comment 8 Fridolin Somers 2014-01-03 09:06:59 UTC
Patch pushed to 3.14.x, will be in 3.14.2.