Просмотр исходного кода

Fixes #3044: Ignore site/rack fields when connecting a new cable via device search

Jeremy Stretch 6 лет назад
Родитель
Сommit
090efde21a
2 измененных файлов с 4 добавлено и 2 удалено
  1. 1 0
      CHANGELOG.md
  2. 3 2
      netbox/project-static/js/forms.js

+ 1 - 0
CHANGELOG.md

@@ -5,6 +5,7 @@ v2.5.10 (FUTURE)
 * [#3036](https://github.com/digitalocean/netbox/issues/3036) - DCIM interfaces API endpoint should not include VM interfaces
 * [#3039](https://github.com/digitalocean/netbox/issues/3039) - Fix exception when retrieving change object for a component template via API
 * [#3041](https://github.com/digitalocean/netbox/issues/3041) - Fix form widget for bulk cable label update
+* [#3044](https://github.com/digitalocean/netbox/issues/3044) - Ignore site/rack fields when connecting a new cable via device search
 
 ---
 

+ 3 - 2
netbox/project-static/js/forms.js

@@ -156,11 +156,12 @@ $(document).ready(function() {
                 filter_for_elements.each(function(index, filter_for_element) {
                     var param_name = $(filter_for_element).attr(attr_name);
                     var is_nullable = $(filter_for_element).attr("nullable");
+                    var is_visible = $(filter_for_element).is(":visible");
                     var value = $(filter_for_element).val();
 
-                    if (param_name && value) {
+                    if (param_name && is_visible && value) {
                         parameters[param_name] = value;
-                    } else if (param_name && is_nullable) {
+                    } else if (param_name && is_visible && is_nullable) {
                         parameters[param_name] = "null";
                     }
                 });