[open-ils-commits] [GIT] Evergreen ILS branch rel_3_1 updated. 7c995a6ee36f54ce010af30c128a4ab81f3aec4b

Evergreen Git git at git.evergreen-ils.org
Wed May 9 09:38:26 EDT 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_3_1 has been updated
       via  7c995a6ee36f54ce010af30c128a4ab81f3aec4b (commit)
      from  8e2d9325ba8e3f40f5da159293c7382e49eb3036 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 7c995a6ee36f54ce010af30c128a4ab81f3aec4b
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date:   Thu Apr 19 15:11:41 2018 -0400

    LP#1765501: ensure that webstaff MARC editor can deal with short 008s
    
    This patch ensures that the 008 field, when maintained by the web staff
    MARC editor, is kept at its proper length. In particular, this solves a
    problem where input can get messed up if the user selects the entire
    contents of the 008 field and replaces it with a shorter string.
    
    To test
    ------
    [1] Create a new bib record. Ensure that the MARC record editor is
        /not/ in flat text mode.
    [2] Edit the 008 field by selecting its entire contents and replacing it
        with a subset. For example, this might be done when the first action
        that a cataloger takes is to set the 008/00-05.
    [3] Enter value in the individual fixed-field inputs at the top of the
        MARC editor form. For example, enter 'eng' in the Lang field.
    [4] Note that the results are wrong; e.g., the text ends up as
        "080419en en eng".
    [5] Apply the patch and repeat steps #1-#4. This time, the results
        should be correct.
    
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
    Signed-off-by: Cesar Velez <cesar.velez at equinoxinitiative.org>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/web/js/ui/default/staff/marcrecord.js b/Open-ILS/web/js/ui/default/staff/marcrecord.js
index fa4db5b..9fe525b 100644
--- a/Open-ILS/web/js/ui/default/staff/marcrecord.js
+++ b/Open-ILS/web/js/ui/default/staff/marcrecord.js
@@ -523,6 +523,16 @@ var MARC21 = {
                         value = value.substr(0, MARC21.Record._ff_pos[field]._8[rtype].len);
                     while (value.length < MARC21.Record._ff_pos[field]._8[rtype].len)
                         value += MARC21.Record._ff_pos[field]._8[rtype].def;
+
+                    // first ensure that 008 is padded to appropriate length
+                    var f008_length = (rtype in MARC21.Record._ff_lengths['008']) ?
+                        MARC21.Record._ff_lengths['008'][rtype] :
+                        MARC21.Record._ff_lengths['008']['default'];
+                    if (_8.length < f008_length) {
+                        for (var i = _8.length; i < f008_length; i++) {
+                            _8 += ' ';
+                        }
+                    }
                     this.field('008').update(
                         _8.substring(0, MARC21.Record._ff_pos[field]._8[rtype].start) +
                         value +
@@ -1111,6 +1121,13 @@ MARC21.Record._recType = {
     MFHD : { Type : /[uvxy]{1}/,  BLvl : /.{1}/ }
 };
 
+MARC21.Record._ff_lengths = {
+    '008' : {
+        default : 40,
+        MFHD    : 32
+    }
+}
+
 MARC21.Record._ff_pos = {
     AccM : {
         _8 : {

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/web/js/ui/default/staff/marcrecord.js |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list