TPAC: MFHD editor menu chokes on MFHD records with single-quote in 852 field

Bug #1046931 reported by Dan Scott
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
High
Unassigned
2.2
Fix Released
High
Unassigned

Bug Description

* Evergreen 2.3.0 RC1-ish

Using the TPAC in the staff client, with a serial.record_entry like the following attached to a given bib record:

<record xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.loc.gov/MARC21/slim"><leader>00318cy a22001094 4500</leader><controlfield tag="001">14142</controlfield><controlfield tag="003">SUDBURY</controlfield><controlfield tag="005">20120712194743.0</controlfield><controlfield tag="008">081111 eng 090407</controlfield><datafield tag="852" ind1=" " ind2=" "><subfield code="b">Universit&#xe9; de Sudbury</subfield><subfield code="c">Salle des p&#xe9;riodiques</subfield></datafield><datafield tag="853" ind1=" " ind2=" "><subfield code="a">Dec 1, 2008</subfield></datafield><datafield tag="852" ind1=" " ind2=" "><subfield code="a">La biblioth&#xe8;que tient l'ann&#xe9;e courant seulement.</subfield></datafield><datafield tag="866" ind1=" " ind2=" "><subfield code="a">Le dernier num&#xe9;ro re&#xe7;u : V. 37, no.12 (Ao&#xfb;t 2012).</subfield></datafield><datafield tag="935" ind1=" " ind2=" "><subfield code="a">a911552</subfield></datafield><datafield tag="901" ind1=" " ind2=" "><subfield code="c">14142</subfield><subfield code="t">serial</subfield><subfield code="o">107</subfield><subfield code="r">911552</subfield></datafield></record>

Complaint was that the staff client didn't offer any way to edit the MFHD record.

JavaScript console showed:

Timestamp: 2012-09-06 11:42:12 AM
Error: SyntaxError: missing } after property list
Source File: oils://remote/eg/opac/record/700941?query=%28title%3Ale%20voyageur%29;qtype=title;locg=107;_adv=1;page=0
Line: 764, Column: 108
Source Code:
                    'label' : 'Université de Sudbury -- Salle des périodiques -- La bibliothèque conserve l'année courante seulement.',

It took a bit too long to figure out that the "'" in the 852 "La bibliothèque conserve l'année courante seulement" was prematurely terminating the value attached to the 'label' property.

The solution is to escape incoming single-quotes in the MFHD location values. Thus - user/dbs/tpac_escape_sre_label in working (which probably needs to be backported all the way to rel_2_2).

Revision history for this message
Lebbeous Fogle-Weekley (lebbeous) wrote :

Hi Dan,

I've tested and signed off here. The patch definitely prevents 852$a values like "This is a test's test" from breaking the

    Actions for this Record -> MFHD Holdings -> {Edit,Delete} MHFD Record

menu entries.

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

Revision history for this message
Dan Wells (dbw2) wrote :

Pushed back through rel_2_3 with a triple sign-off. Thanks, guys.

Changed in evergreen:
status: New → Fix Committed
milestone: none → 2.3.0
Changed in evergreen:
status: Fix Committed → Fix Released
Revision history for this message
Ben Shum (bshum) wrote :

Cherry-picked this to rel_2_2 as mentioned but never done.

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.