]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1594066 - reproducible "Can't use ARRAY(0x17340610) as a field name." when Custom...
authorKohei Yoshino <kohei.yoshino@gmail.com>
Mon, 11 May 2020 16:37:30 +0000 (12:37 -0400)
committerGitHub <noreply@github.com>
Mon, 11 May 2020 16:37:30 +0000 (12:37 -0400)
js/advanced-search.js

index 259f790b2146f7191e9128fed54b2e2571746eb7..e98a8753f8ef451cbc74aba316b0cda9e00ec5c5 100644 (file)
@@ -130,6 +130,7 @@ Bugzilla.CustomSearch = class CustomSearch {
   update_input_names() {
     let index = 1;
     let cp_index = 0;
+    const cp_indexes = [];
 
     // Cache radio button states, which can be reset while renaming
     const radio_states =
@@ -141,6 +142,7 @@ Bugzilla.CustomSearch = class CustomSearch {
         // CP needs to be added after all the rows and nested subgroups within the current group.
         // Example: f1=OP, f2=product, f3=component, f4=OP, f5=reporter, f6=assignee, f7=CP, f8=CP
         cp_index = index + $item.querySelectorAll('.row').length + ($item.querySelectorAll('.group').length * 2) + 1;
+        cp_indexes.push(cp_index);
       }
 
       [...$item.querySelectorAll('[name]')].filter($input => $input.closest('.condition') === $item).forEach($input => {
@@ -149,7 +151,7 @@ Bugzilla.CustomSearch = class CustomSearch {
 
       index++;
 
-      if (index === cp_index) {
+      while (cp_indexes.includes(index)) {
         index++;
       }
     });