Record attribute definitions that use xpath can break bib ingest

Bug #1442796 reported by Galen Charlton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned
2.7
Fix Released
Medium
Unassigned
2.8
Fix Released
Undecided
Unassigned

Bug Description

Record attribute definitions that use XPath to extract their values can break ingest. For example, consider the following definition:

-[ RECORD 1 ]+------------------------------------------------------
name | content_type
label | Content Type
description |
multi | t
filter | t
sorter | f
composite | f
tag |
sf_list |
joiner |
xpath | //marc:datafield[@tag='336']/marc:subfield[@code='a']
format | marcxml
start_pos |
string_len |
fixed_field |
phys_char_sf |

Attempting to ingest a bib that has a 336$a will fail with the following error:

CONTEXT: SQL statement "SELECT metabib.reingest_record_attributes(NEW.id, NULL, NEW.marc, TG_OP = 'INSERT' OR OLD.deleted)"
PL/pgSQL function biblio.indexing_ingest_or_delete() line 50 at PERFORM
ERROR: invalid XML content
DETAIL: line 1: AttValue: " or ' expected
{"<subfield code=\"a\">two-dimensional moving</subfield>"}
                 ^
line 1: attributes construct error
{"<subfield code=\"a\">two-dimensional moving</subfield>"}

Evergreen master

Tags: pullrequest
Galen Charlton (gmc)
Changed in evergreen:
importance: Undecided → Medium
Revision history for this message
Galen Charlton (gmc) wrote :

A fix is available at the tip of the user/gmcharlt/lp1442796_fix_xpath_based_crad brach in the working/Evergreen repository:

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/gmcharlt/lp1442796_fix_xpath_based_crad

tags: added: pullrequest
Changed in evergreen:
milestone: none → 2.8.1
Changed in evergreen:
milestone: 2.8.1 → 2.8.3
no longer affects: evergreen/2.6
Changed in evergreen:
status: New → Triaged
Revision history for this message
Jason Stephenson (jstephenson) wrote :

This was merged into master as part of the larger web staff client sprint2 branch.

I'm not sure how we might want to back port this. The upgrade script was assigned 0936 version in master.

Changed in evergreen:
milestone: 2.8.3 → 2.9-beta
status: Triaged → Fix Committed
Revision history for this message
Ben Shum (bshum) wrote :

Backported to rel_2_8 and rel_2_7.

Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.