Browse Source

Custom fields: values not recorded if the user does not change any of the default values

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3962 a333f486-631f-4898-b8df-5754b55c2be0
romainq 9 years ago
parent
commit
c7e7d28148
1 changed files with 2 additions and 0 deletions
  1. 2 0
      application/cmdbabstract.class.inc.php

+ 2 - 0
application/cmdbabstract.class.inc.php

@@ -1951,6 +1951,8 @@ EOF
 					$oPage->add_ready_script("$('#{$iId}_console_form').console_form_handler('option', 'field_set', $('#{$iId}_field_set'));");
 					// field_change must be processed to refresh the hidden value at anytime
 					$oPage->add_ready_script("$('#{$iId}_console_form').bind('value_change', function() { $('#{$iId}').val(JSON.stringify($('#{$iId}_field_set').triggerHandler('get_current_values'))); });");
+					// Initialize the hidden value with current state
+					$oPage->add_ready_script("$('#{$iId}_console_form').trigger('value_change');");
 					// update_value is triggered when preparing the wizard helper object for ajax calls
 					$oPage->add_ready_script("$('#{$iId}').bind('update_value', function() { $(this).val(JSON.stringify($('#{$iId}_field_set').triggerHandler('get_current_values'))); });");
 					// validate is triggered by CheckFields, on all the input fields, once at page init and once before submitting the form