From 61e878af621d63df70a8718a42fd1dddb48599f0 Mon Sep 17 00:00:00 2001
From: Bruno Massa <brmassa@67164.no-reply.drupal.org>
Date: Tue, 12 May 2009 20:00:56 +0000
Subject: [PATCH] Bugs fixed: * #426438 by brmassa: If the chart data is
 missing the provider file, it must not end as an error

---
 charts.module | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/charts.module b/charts.module
index d8564f3..2f0a2b3 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
+}
-- 
GitLab