Problem: -------- When a new marc record is added, the language code in field 008 Range 35-37 defaults to Englih ("eng"). This makes cataloguing inefficient and error-prone for librarians if most of the bibliographic data is e.g. in German or in French. Background: ----------- The language code for English (eng) is hard coded in the files ...koha\intranet\cgi-bin\cataloguing\value_builder\marc21_field_008.pl (~Lines 61, 100) and ...koha\intranet\cgi-bin\cataloguing\value_builder\normarc_field_008.pl (~Lines 58, 98) Proposition: ------------ --Step 1 -------------------------- Add somewhere to cataloguing.pref, section "Record Structure" : ----------------------------------- - - Fill in the default language for field 008 Range 35-37 (e.g. eng, nor, ger, see <a href="http://www.loc.gov/marc/languages/language_code.html">MARC Code List for Languages</a>) - pref: DefaultLanguageField008 - " Empty defaults to eng." --Step 2 -------------------------- Change marc21_field_008.pl and normarc_field_008.pl as follows: ----------------------------------- --2a--- Add 3 lines of code at the top of the functions sub plugin_javascript and sub plugin: my $lang = C4::Context->preference('DefaultLanguageField008' ); $lang = "eng" unless $lang; $lang = pack("A3", $lang); The code defaults an empty value to "eng" makes sure that the code has a lenght of 3 letters. --2b--- In both functions, replace hard coded eng with $lang: document.getElementById(\"$field_number\").value='$dateentered' + 't xxu||||| |||| 00| 0 $lang d'; $result = "$dateentered" . "t xxu||||| |||| 00| 0 $lang d" unless $result; --Step 3---------------------------------------------------------------------- Login to Koha, go to Home › Administration › System Preferences (Cataloging) and test with empty value and different language codes (ger, ita etc.) ------------------------------------------------------------------------------ I implemented and tested this locally with marc21_field_008.pl (Koha 3.06.02.003)
Created attachment 7881 [details] Changed marc21_field_008.pl
Created attachment 7882 [details] cataloguing.pref with preference for 008 default language added
Created attachment 9987 [details] [review] Bug 7601 - Preference for default language for field 008 Range 35-37 (instead of hard coded "eng") When a new marc record is added, the language code in field 008 Range 35-37 defaults to Englih ("eng"). This makes cataloguing inefficient and error-prone for librarians if most of the bibliographic data is e.g. in German or in French. Test: - Apply patch - Edit preference DefaultLanguageField008, fill in e.g. 'ger' - Go to Cataloguing, Add marc Record - Click in field 008. Language code should read 'ger' (instead of 'eng')
Created attachment 9988 [details] [review] Bug 7601 - Preference for default language for field 008 Range 35-37 (instead of hard coded "eng") When a new marc record is added, the language code in field 008 Range 35-37 defaults to Englih ("eng"). This makes cataloguing inefficient and error-prone for librarians if most of the bibliographic data is e.g. in German or in French. Test: - Apply patch - Edit preference DefaultLanguageField008, fill in e.g. 'ger' - Go to Cataloguing, Add marc Record - Click in field 008. Language code should read 'ger' (instead of 'eng') Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
QA comment: * small patch that replaces a hardcoded value by a syspref * Despite his size, the content of the patch is tiny, loading the syspref, filling it to 3 chars, and using it instead of the default passed QA
There have been no further reports of problems so I am marking this bug resolved.