Bug 10329 - Rename system preference marcflavour to MarcFormat
Summary: Rename system preference marcflavour to MarcFormat
Status: CLOSED WONTFIX
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial (vote)
Assignee: Kyle M Hall
QA Contact:
URL:
Keywords:
Depends on:
Blocks: 10327
  Show dependency treegraph
 
Reported: 2013-05-24 11:42 UTC by Kyle M Hall
Modified: 2015-12-03 22:00 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 10329 - Rename system preference marcflavour to MarcFormat (171.95 KB, patch)
2013-05-24 11:45 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 10329 - Rename system preference marcflavour to MarcFormat (163.09 KB, patch)
2013-05-24 12:03 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall 2013-05-24 11:42:06 UTC

    
Comment 1 Kyle M Hall 2013-05-24 11:45:22 UTC Comment hidden (obsolete)
Comment 2 Kyle M Hall 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?