evergreen.maintain_901() can mangle its output
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Evergreen |
Fix Released
|
Critical
|
Unassigned | ||
2.1 |
Fix Released
|
Undecided
|
Unassigned | ||
2.2 |
Fix Released
|
Critical
|
Unassigned |
Bug Description
If a MARCXML record has some elements that use a namespace prefix and some do that do not, the regexp used to insert the 901 can insert it in the wrong place.
For example, consider:
<marc:record xmlns:xsi="http://
<leader>01234cam a22003014a 4500</leader>
<controlfield tag="001"
<controlfield tag="003"
<datafield tag="521" ind1=" " ind2=" ">
<subfield code="a">RL: 3 ; ages 7-12.</subfield>
</datafield>
<datafield tag="800" ind1="1" ind2=" ">
<subfield code="a">Warner, Gertrude Chandler,
<subfield code="d"
<subfield code="t">Boxcar children mysteries.
</datafield>
</marc:record>
maintain_901() would munge the record to something like this:
<marc:record xmlns:xsi="http://
<leader>01234cam a22003014a 4500</leader>
<controlfield tag="001"
<controlfield tag="003"
<datafield tag="521" ind1=" " ind2=" ">
<subfield code="a">RL: 3 ; ages 7-12.<datafield tag="901" ind1=" " ind2=" "><subfield code="a"
</datafield>
<datafield tag="800" ind1="1" ind2=" ">
<subfield code="a">Warner, Gertrude Chandler,
<subfield code="d"
<subfield code="t">Boxcar children mysteries.
</datafield>
</marc:record>
That's not a valid MARCXML record. If one is attempting to reingest that record to add the 901 field (see bug 798702 for why one would do that), you can end up with a misleading error message. In particular, running
update biblio.record_entry set id = id where id = 5322176;
for such a record can get you an error like this:
psql:x.sql:2: ERROR: Tag "" is not a valid tag. at /usr/share/
CONTEXT: PL/Perl function "maintain_
Evergreen: master
Changed in evergreen: | |
milestone: | none → 2.3.0-beta1 |
importance: | Undecided → Medium |
Changed in evergreen: | |
status: | Fix Committed → Fix Released |
Fix is available in the working/Evergreen repository at the tip of branch user/gmcharlt/ lp1028514_ fix_maintain_ 901 . Recommend push to master and rel_2_2.