flat-text MARC editor doesn't handle null indicator values
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\
=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\
=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\
=100 \a$aSimpson, Homer
=245 \a$aDoh! An autobiography.
=901 \\$a5009$
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.
Changed in evergreen: | |
status: | Fix Committed → Fix Released |
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.