]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1296831 - allow answers file to override new install defaults
authorFrank Becker <Frank@Frank-Becker.de>
Wed, 24 Aug 2016 14:25:43 +0000 (10:25 -0400)
committerDylan William Hardison <dylan@hardison.net>
Wed, 24 Aug 2016 14:25:43 +0000 (10:25 -0400)
Bugzilla/Config.pm

index 79b468f0c8d640c8e11cee7a56030e7ac1812b14..49918d5c101233871087457e37661ec88fe2d581 100644 (file)
@@ -36,6 +36,12 @@ use File::Basename;
   );
 Exporter::export_ok_tags('admin');
 
+# new installs get these set of defaults (unless overriden by the answers file)
+my %NEW_INSTALL_DEFAULT = (
+    or_groups          => 1,
+    use_email_as_login => 0,
+);
+
 # INITIALISATION CODE
 # Perl throws a warning if we use bz_locations() directly after do.
 our %params;
@@ -238,17 +244,15 @@ sub update_params {
             elsif (exists $answer->{$name}) {
                 $param->{$name} = $answer->{$name};
             }
+            elsif ($new_install and exists $NEW_INSTALL_DEFAULT{$name}) {
+                $param->{$name} = $NEW_INSTALL_DEFAULT{$name};
+            }
             else {
                 $param->{$name} = $item->{'default'};
             }
         }
     }
 
-    if ($new_install) {
-        $param->{'or_groups'} = 1;
-        $param->{'use_email_as_login'} = 0;
-    }
-
     # --- REMOVE OLD PARAMS ---
 
     my %oldparams;