flat-text MARC editor doesn't handle null indicator values

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

Bug Description

Evergreen version: trunk@19040 (assumed to apply to rel_2_0 and rel_1_6 as well)
OpenSRF: 1.6
Postgres: 8.4
Linux: Debian Squeeze

When creating a MARC record from a template using the flat-text editor, null indicator values are not handled well. For example, using the default k_book template, the initial value is:

=LDR 00620cam a2200205Ka 4500
=008 070101s\\\\\\\\\\\\\\\\\\\\\\\\\\\\eng\d
=010 $a
=020 $a
=082 04$a
=092 $a
=100 $a
[etc.]

This lacks the indicators on the variable data fields. If you don't notice this and input data in the record, e.g.,

=LDR 00620cam a2200205Ka 4500
=008 070101s\\\\\\\\\\\\\\\\\\\\\\\\\\\\eng\d
=100 $aSimpson, Homer
=245 $aDoh! An autobiography.

the resulting record looks like this after saving it and re-opening it in the flat-text editor:

=LDR 00620cam a2200205Ka 4500
=001 5009
=003 CONS
=005 20101222163307.0
=008 070101s\\\\\\\\\\\\\\\\\\\\\\\\\\\\eng\d
=100 \a$aSimpson, Homer
=245 \a$aDoh! An autobiography.
=901 \\$a5009$b$c5009$tbiblio

Note that the second indicator in the 100 and 245 is (incorrectly) set to $a.

Similarly, if you edit a record in the original MARC editor, add a tag, tab through the indicators instead of entering spaces, the resulting tag looks like this in the flat-text editor:

=246 $aDoom

Expected behavior:

[1] When a record is opened in the flat-text editor or seeded from a template, indicator values that are the empty string should be converted to spaces.

[2] Arguably, if the user forgets to enter indicators in the flat-text editor for a variable data field, they should be initialized as blanks. E.g., the editor can look for the pattern /^=(\d{3}) \$/ and (for tag values >= 010), automatically insert the two blank indicator values.

Revision history for this message
Mike Rylander (mrylander) wrote :

The solution proposed in [2] is complicated by the fact that the subfield separator is configurable, but by checking to see if breaker input has a subfield separator in position 4 we can insert the needed indicator placeholders.

This means that users can do either of the following independently:
  * forget to supply indicators
  * fail to supply a leading subfield delimiter

but not both together -- we can't tell the difference between those states programatically.

Implemented in r19049.

Changed in evergreen:
status: New → Fix Committed
Revision history for this message
Mike Rylander (mrylander) wrote :

Note, until I have confirmation of the efficacy of r19049 I won't be backporting to a release-generating branch such as rel_2_0 or rel_1_6_2. Testers, please!

Revision history for this message
Galen Charlton (gmc) wrote :

I've tested Mike's patch; added a follow-up of my own, and backported to rel_1_6, rel_1_6_2, and rel_2_0.

Changed in evergreen:
importance: Undecided → Medium
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.