|
@@ -14,6 +14,7 @@
|
|
function fgcf_views_default_views() {
|
|
function fgcf_views_default_views() {
|
|
// Needed to avoid fatal 'class view not found' error when Features
|
|
// Needed to avoid fatal 'class view not found' error when Features
|
|
// checks the status of the feature.
|
|
// checks the status of the feature.
|
|
|
|
+ // http://drupal.org/node/509174#comment-2715130
|
|
views_include('view');
|
|
views_include('view');
|
|
|
|
|
|
$info = fgcf_views_api();
|
|
$info = fgcf_views_api();
|
|
@@ -31,9 +32,17 @@ function fgcf_views_default_views() {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
|
|
- require_once $name; // will define $view and $handler
|
|
|
|
- $views[$view->name] = $view;
|
|
|
|
|
|
+ // Cannot use require_once, as scanning may load them once before entering
|
|
|
|
+ // here, and they need to be reported each time.
|
|
|
|
+ require $name; // will define $view and $handler
|
|
|
|
+ if (!isset($view) || !isset($view->name)) {
|
|
|
|
+ watchdog('fgcf', 'Ill-formed view @name.', array('@name' => $name), WATCHDOG_NOTICE);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ $views[$view->name] = $view;
|
|
|
|
+ }
|
|
unset($view, $handler);
|
|
unset($view, $handler);
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
return $views;
|
|
return $views;
|