From 0e33bbb88de54bb9ae86714615bf768e347a6514 Mon Sep 17 00:00:00 2001 From: Simon Hieu Mai Date: Thu, 7 Mar 2013 10:21:21 -0600 Subject: [PATCH] LP#1152235: Editing MARC Fixed Fields - fix blank field behavior When editing a field that had data in it to be blank, libs staff must fill in spaces to take up that space. Otherwise, it retains the old data (after saving record). This patch will do that job (adding those spaces). Signed-off-by: Simon Hieu Mai --- Open-ILS/xul/staff_client/server/cat/marcedit.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Open-ILS/xul/staff_client/server/cat/marcedit.js b/Open-ILS/xul/staff_client/server/cat/marcedit.js index 1fbf544dd6..f494bf99b1 100644 --- a/Open-ILS/xul/staff_client/server/cat/marcedit.js +++ b/Open-ILS/xul/staff_client/server/cat/marcedit.js @@ -819,8 +819,11 @@ function updateFixedFields (element) { var new_value = element.value; // Don't take focus away/adjust the record on partial changes var length = element.getAttribute('maxlength'); - if(new_value.length < length) return true; + if ((new_value.length < length) & (new_value.length > 0)) return true; + if (new_value.length == 0){ + for (var i = 0;i < length;i++){ new_value = new_value + ' ';} + } var marc_rec = new MARC.Record ({ delimiter : '$', marcxml : xml_record.toXMLString() }); marc_rec.setFixedField(element.getAttribute('name'), new_value); -- 2.11.0