]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1572945 - Cannot enter bug through Guided Bug Form if the product’s default platf...
authorKohei Yoshino <kohei.yoshino@gmail.com>
Mon, 12 Aug 2019 21:46:10 +0000 (17:46 -0400)
committerGitHub <noreply@github.com>
Mon, 12 Aug 2019 21:46:10 +0000 (17:46 -0400)
extensions/GuidedBugEntry/web/js/guided.js

index fd79f26025b8bfc1f139ee83858a04a1ed0d664c..b5127f786f81502830bdacce25b8ca4c12b3f4c0 100644 (file)
@@ -724,10 +724,21 @@ var bugForm = {
     }
     bugForm.onVersionChange(elVersions.value);
 
-    // set default hw/os/group
-    Dom.get('rep_platform').value = product.details.default_platform;
-    Dom.get('op_sys').value = product.details.default_op_sys;
-    Dom.get('groups').value = product.details.default_security_group;
+    // Set default Platform, OS and Security Group
+    // Skip if the default value is empty = auto-detect
+    const { default_platform, default_op_sys, default_security_group } = product.details;
+
+    if (default_platform) {
+      document.querySelector('#rep_platform').value = default_platform;
+    }
+
+    if (default_op_sys) {
+      document.querySelector('#op_sys').value = default_op_sys;
+    }
+
+    if (default_security_group) {
+      document.querySelector('#groups').value = default_security_group;
+    }
   },
 
   onComponentChange: function(componentName) {