# This patch file was generated by NetBeans IDE
# Following Index: paths are relative to: /var/www/html/zabbix/branches/dev/ZBXNEXT-2102-master/frontends
# This patch can be applied using context Tools: Patch action on respective folder.
# It uses platform neutral UTF-8 encoding and \n newlines.
# Above lines and this line are ignored by the patching process.
Index: app/controllers/CControllerWidgetSysmapView.php
--- app/controllers/CControllerWidgetSysmapView.php No Base Revision
+++ app/controllers/CControllerWidgetSysmapView.php Locally New
Index: php/app/controllers/CControllerDashboardView.php
--- php/app/controllers/CControllerDashboardView.php Base (BASE)
+++ php/app/controllers/CControllerDashboardView.php Locally Modified (Based On LOCAL)
@@ -394,6 +394,12 @@
 			$widgetid = $widget['widgetid'];
 			$default_rf_rate = CWidgetConfig::getDefaultRfRate($widget['type']);
 
+			$widget_fields = self::convertWidgetFields($widget['fields']);
+			$widget_form = CWidgetConfig::getForm($widget['type'], json_encode($widget_fields));
+			if ($widget_form->validate()) {
+				$widget_fields = $widget_form->getFieldsData();
+			}
+
 			$grid_widgets[$widgetid] = [
 				'widgetid' => $widgetid,
 				'type' => $widget['type'],
@@ -405,7 +411,7 @@
 					'height' => (int) $widget['height']
 				],
 				'rf_rate' => (int) CProfile::get('web.dashbrd.widget.rf_rate', $default_rf_rate, $widgetid),
-				'fields' => self::convertWidgetFields($widget['fields'])
+				'fields' => $widget_fields
 			];
 		}
 
Index: php/app/controllers/CControllerWidgetNavigationtreeView.php
--- php/app/controllers/CControllerWidgetNavigationtreeView.php Base (BASE)
+++ php/app/controllers/CControllerWidgetNavigationtreeView.php Locally Modified (Based On LOCAL)
Index: php/include/classes/widgetfields/CWidgetField.php
--- php/include/classes/widgetfields/CWidgetField.php Base (BASE)
+++ php/include/classes/widgetfields/CWidgetField.php Locally Modified (Based On LOCAL)
@@ -173,6 +173,7 @@
 		$label = ($this->label === null) ? $this->name : $this->label;
 
 		if (!CApiInputValidator::validate($validation_rules, $value, $label, $error)) {
+			$this->setValue($this->default);
 			$errors[] = $error;
 		}
 
Index: php/js/class.cnavtree.js
--- php/js/class.cnavtree.js Base (BASE)
+++ php/js/class.cnavtree.js Locally Modified (Based On LOCAL)
Index: php/js/menupopup.js
--- php/js/menupopup.js Base (BASE)
+++ php/js/menupopup.js Locally Modified (Based On LOCAL)
Index: php/jsLoader.php
--- php/jsLoader.php Base (BASE)
+++ php/jsLoader.php Locally Modified (Based On LOCAL)
