#721: BibUpload: fix troubles with multiple 001 tags
-----------------------+---------------------
 Reporter:  simko      |      Owner:  skaplun
     Type:  defect     |     Status:  new
 Priority:  blocker    |  Milestone:  v1.0
Component:  BibUpload  |    Version:
 Keywords:             |
-----------------------+---------------------
 Consider the following input test file:

 {{{
 <collection>
   <record>
     <controlfield tag="001">1234</controlfield>
     <datafield tag="100" ind1=" " ind2=" ">
       <subfield code="a">Doe, J</subfield>
     </datafield>
     <datafield tag="245" ind1=" " ind2=" ">
       <subfield code="a">On the foo and bar</subfield>
     </datafield>
   </record>
 </collection>
 }}}

 submitted via:

 {{{
 $ sudo -u www-data /opt/invenio/bin/bibupload -ir /tmp/z.xml
 }}}

 Record 345 (say) will be created with the following content:

 {{{
 <?xml version="1.0" encoding="UTF-8"?>
 <collection xmlns="http://www.loc.gov/MARC21/slim";>
 <record>
   <controlfield tag="001">1234</controlfield>
   <controlfield tag="001">345</controlfield>
   <datafield tag="100" ind1=" " ind2=" ">
     <subfield code="a">Doe, J</subfield>
   </datafield>
   <datafield tag="245" ind1=" " ind2=" ">
     <subfield code="a">On the foo and bar</subfield>
   </datafield>
 </record>
 </collection>
 }}}

 Note multiple 001 tags, which has various interesting troubles WRT record
 existence, findability, etc.

 We should (1) make sure the record gets either stored with record ID 1234,
 or with 345, but not both; (2) plug a new global check before internally
 finishing the upload step to make sure that no combination of input
 parameters and incoming XML could result in multiple 001 tags; (3) write a
 regression test case covering this trouble.

-- 
Ticket URL: <http://invenio-software.org/ticket/721>
Invenio <http://invenio-software.org>

Reply via email to