diff --git a/includes/charts.pages.inc b/includes/charts.pages.inc index 90b2e338513b5d26a1ccd90285d38953aa65e57c..843396652a173e19faf6637392e41b51e6d75ffb 100644 --- a/includes/charts.pages.inc +++ b/includes/charts.pages.inc @@ -305,7 +305,8 @@ function charts_settings_form($form, $defaults = array(), $field_options = array * Menu callback; Configure the site-wide defaults for charts. */ function charts_default_settings_form($form, $form_state) { - $defaults = variable_get('charts_default_settings', charts_default_settings()); + $defaults = variable_get('charts_default_settings', array()); + $defaults += charts_default_settings(); $field_options = array(); $parents = array('charts_default_settings'); diff --git a/views/charts_plugin_style_chart.inc b/views/charts_plugin_style_chart.inc index c2b850470115fb4657895abfa15e3a120f2288d0..f6fa08875884ffa4cf42a99c89c8b829b8f29e90 100644 --- a/views/charts_plugin_style_chart.inc +++ b/views/charts_plugin_style_chart.inc @@ -18,16 +18,12 @@ class charts_plugin_style_chart extends views_plugin_style { // Get the default chart values module_load_include('inc', 'charts', 'includes/charts.pages'); - $defaults = variable_get('charts_default_settings', charts_default_settings()); + $defaults = variable_get('charts_default_settings', array()); + $defaults += charts_default_settings(); foreach ($defaults as $default_key => $default_value) { $options[$default_key]['default'] = $default_value; } - // Views-specific chart options. - $options['label_field'] = array( - 'default' => NULL, - ); - return $options; } @@ -67,6 +63,11 @@ class charts_plugin_style_chart extends views_plugin_style { $errors = array(); $field_handlers = $this->display->handler->get_handlers('field'); + // Don't execute validation on the new view page. + if ($_GET['q'] === 'admin/structure/views/add') { + return; + } + if (count($field_handlers)) { $data_field_key = !empty($this->options['data_fields']) ? current($this->options['data_fields']) : NULL; if (empty($data_field_key)) {