Skip to content
Snippets Groups Projects
Commit cf2b7d4b authored by Bruno Massa's avatar Bruno Massa
Browse files

Bugs fixed:

* Dont crash or point errors when the default plugin was not yet defined
parent 81663180
No related branches found
No related tags found
No related merge requests found
...@@ -161,7 +161,9 @@ function _charts_settings($form_state) { ...@@ -161,7 +161,9 @@ function _charts_settings($form_state) {
'#type' => 'select', '#type' => 'select',
'#title' => t('Chart plugin'), '#title' => t('Chart plugin'),
); );
asort($charts_info[$settings['#plugin']]['types']); if (!empty($settings['#plugin'])) {
asort($charts_info[$settings['#plugin']]['types']);
}
$form['type'] = array( $form['type'] = array(
'#default_value' => empty($settings['#type']) ? '' : $settings['#type'], '#default_value' => empty($settings['#type']) ? '' : $settings['#type'],
'#options' => $charts_info[$settings['#plugin']]['types'], '#options' => $charts_info[$settings['#plugin']]['types'],
......
...@@ -20,13 +20,13 @@ ...@@ -20,13 +20,13 @@
* JavaScript external files) * JavaScript external files)
*/ */
function charts_chart(&$data) { function charts_chart(&$data) {
if (empty($data['#plugin'])) {
return '';
}
// Get the previously saved data from database // Get the previously saved data from database
$settings = variable_get('charts_settings', array()); $settings = variable_get('charts_settings', array());
if (empty($data['#plugin']) and empty($settings['#plugin'])) {
return '';
}
// Split the color palette data into inidividual values // Split the color palette data into inidividual values
$color_palette = explode(',', ereg_replace('#', '', $settings['#color_palette'])); $color_palette = explode(',', ereg_replace('#', '', $settings['#color_palette']));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment