[Koha-patches] [PATCH] 2563 - could not input into marc 008, fields 7-10 and 11-14

John Beppu john.beppu at liblime.com
Mon Oct 27 18:40:05 CET 2008


You actually *could* input data into those fields, but it wasn't
immediately obvious, because the field size was "4" and the
value was "    ".  You couldn't type anything in until you
backspaced over the spaces that were there by default.

To work around this, the fields were blanked to start with, and
upon submit, they were padded if necessary (so the data wouldn't
be corrupted).
---
 cataloguing/value_builder/marc21_field_008.pl      |    4 ++++
 .../value_builder/marc21_field_008.tmpl            |    7 ++++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/cataloguing/value_builder/marc21_field_008.pl b/cataloguing/value_builder/marc21_field_008.pl
index 02af66c..793f013 100755
--- a/cataloguing/value_builder/marc21_field_008.pl
+++ b/cataloguing/value_builder/marc21_field_008.pl
@@ -111,6 +111,10 @@ sub plugin {
 	my $f38 = substr($result,38,1);
 	my $f39 = substr($result,39,1);
 
+	# bug 2563
+	$f710  = "" if ($f710  =~ /^\s*$/);
+	$f1114 = "" if ($f1114 =~ /^\s*$/);
+
 if ((!$f1) ||($f1 =~ m/ /)){
 	$f1=$dateentered;
 }
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.tmpl
index 302fd60..99c7904 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.tmpl
@@ -610,12 +610,13 @@
 function report() {
             var doc   = opener.document; 
             var field = doc.getElementById("<!-- TMPL_VAR NAME='index'-->");
-        
             field.value = 
 			document.f_pop.f1.value+
 			document.f_pop.f6.value+
-			document.f_pop.f710.value+
-			document.f_pop.f1114.value+
+			// bug 2563 {
+			( document.f_pop.f710.value.match(/^\s*$/)  ? "    " : document.f_pop.f710.value  )+
+			( document.f_pop.f1114.value.match(/^\s*$/) ? "    " : document.f_pop.f1114.value )+
+			// }
 			document.f_pop.f1517.value+
 			document.f_pop.f1821.value+
 			document.f_pop.f22.value+
-- 
1.6.0.3




More information about the Koha-patches mailing list