diff --git a/charts.module b/charts.module index d8564f3a12f5486e58bb742bf028cd946c37b7c8..2f0a2b3b79bd290bdb2e764cfa6b3a7e61df910c 100644 --- a/charts.module +++ b/charts.module @@ -71,9 +71,13 @@ function charts_chart(&$data) { // Get the information about chart modules $chart_provider = module_invoke_all('charts_info'); - // Include the file that has the rendering function - include_once $chart_provider[$data['#plugin']]['file']; - if ($func = $chart_provider[$data['#plugin']]['render']) { + if (isset($chart_provider[$data['#plugin']]['file']) + and is_file($chart_provider[$data['#plugin']]['file']) + and $func = $chart_provider[$data['#plugin']]['render']) { + + // Include the file that has the rendering function + include_once $chart_provider[$data['#plugin']]['file']; + // Using the filter's rendering function, print the chart return $func($data); } @@ -172,4 +176,4 @@ function charts_views_api() { 'api' => 2, 'path' => drupal_get_path('module', 'charts') .'/views', ); -} \ No newline at end of file +}