Bug 10329

Summary: Rename system preference marcflavour to MarcFormat
Product: Koha Reporter: Kyle M Hall <kyle.m.hall>
Component: Architecture, internals, and plumbingAssignee: Kyle M Hall <kyle.m.hall>
Status: CLOSED WONTFIX QA Contact:
Severity: trivial    
Priority: P5 - low CC: dcook, kyle, m.de.rooy
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on:    
Bug Blocks: 10327    
Attachments: Bug 10329 - Rename system preference marcflavour to MarcFormat
Bug 10329 - Rename system preference marcflavour to MarcFormat

Description Kyle M Hall 2013-05-24 11:42:06 UTC

    
Comment 1 Kyle M Hall (khall) 2013-05-24 11:45:22 UTC Comment hidden (obsolete)
Comment 2 Kyle M Hall (khall) 2013-05-24 12:03:43 UTC
Created attachment 18380 [details] [review]
Bug 10329 - Rename system preference marcflavour to MarcFormat

Test Plan:
1) Apply this patch
2) Run updatedatabase.pl
3) View and edit some records
4) You should not see any change in functionality
Comment 3 Marcel de Rooy 2013-06-10 09:37:45 UTC
Impressive.

But do a grep with case insensitive please too:

my $marcFlavour (no blocker, someone using this variable in bulkmarcimport)

More serious:
misc/migration_tools/switch_marc21_series_info.pl:if (C4::Context->preference('M
ARCFLAVOUR') eq 'UNIMARC') {
t/db_dependent/Linker_FirstMatch.t:    if (C4::Context->preference('MARCFlavour'
) eq 'UNIMARC') {

I have my doubts on your changes in xt/fix-old-fsf-address.exclude
Here you are changing folder names. 
Please check.
Comment 4 Marcel de Rooy 2013-06-10 09:42:05 UTC
Your changes in updatedatabase need correction too (two updates!!)

+$DBversion = "3.13.00.XXX";
+if ( CheckVersion($DBversion) ) {
+    $dbh->do("UPDATE systempreferences SET variable = 'marcflavour' WHERE variable = 'marcflavour'");
+    print "Upgrade to $DBversion done (Bug 10329 - Rename system preference marcflavour to marcflavour)\n";
+    SetVersion ($DBversion);
+}
+
 $DBversion = "3.00.00.009";
 if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
 
@@ -3259,7 +3266,7 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
 	$dbh->do(qq{
 	ALTER TABLE deleteditems ADD UNIQUE INDEX deleteditemsstocknumberidx (stocknumber);
 	});
-	if (C4::Context->preference('marcflavour') eq 'UNIMARC'){
+        if (C4::Context->preference('marcflavour') eq 'UNIMARC'){
 		$dbh->do(qq{
 	INSERT IGNORE INTO marc_subfield_structure (frameworkcode,tagfield, tagsubfield, tab, repeatable, mandatory,kohafield)
 	SELECT DISTINCT (frameworkcode),995,"j",10,0,0,"items.stocknumber" from biblio_framework ;
@@ -6971,6 +6978,13 @@ if(CheckVersion($DBversion)) {
     SetVersion ($DBversion);
 }
 
+$DBversion = "3.13.00.XXX";
+if ( CheckVersion($DBversion) ) {
+   $dbh->do("UPDATE systempreferences SET variable = 'MarcFormat' WHERE variable = 'marcflavour'");
+   print "Upgrade to $DBversion done (Bug 10329 - Rename system preference marcflavour to MarcFormat)\n";
+   SetVersion ($DBversion);

I did get two lines indeed when running this:
    Upgrade to 3.13.00.XXX done (Bug 10329 - Rename system preference marcflavour to marcflavour)
    Upgrade to 3.13.00.XXX done (Bug 10329 - Rename system preference marcflavour to MarcFormat)
Comment 5 David Cook 2013-06-13 05:21:37 UTC
I'm just about to submit a patch that uses marcflavour...

With the renaming of system preferences, I imagine we're going to want to be quite careful with our sign offs and QA for a little while...

http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10456
Comment 6 Katrin Fischer 2013-06-16 07:00:45 UTC
Hi Kyle,
I think we both know that your test plan here is a bit too optimistic? ;) marcflavor is used in like a gazillion places to make things work correctly, so there is probably no way at all to test this from the GUI. Marcel++ for thinking about case insensitivity!

I am not sure if the win here is worth the risk. The system preference name doesn't contain critical characters like underscores or hyphens and it's only to be set at installation time. Might it be more confusing for developers to change it now that we have been using the term for so long?