Commit 8c3fe799 authored by Cody Craven's avatar Cody Craven
Browse files

Issue #1274870 by codycraven: Fixed views plugin reporting error when no result.

parent 7130b022
......@@ -2,6 +2,7 @@
Taxonomy Display 7.x-1.x, YYYY-MM-DD
------------------------------------
Issue #1274870 by codycraven: Fixed views plugin reporting error when no result.
Issue #1261270 by codycraven: Added caching to fetch taxonomy display settings.
Taxonomy Display 7.x-1.0-rc2, 2011-08-17
......
......@@ -27,13 +27,16 @@ class TaxonomyDisplayAssociatedDisplayHandlerViews extends TaxonomyDisplayAssoci
$build = array();
$embed_view = views_embed_view($options['view'], $options['display'], $term->tid);
// The code below essentially mimics views_embed_view() but outputs a
// watchdog error if the view/view display isn't valid.
// TODO: Test the watchdog presents how I'm expecting
if (empty($embed_view)) {
$view = views_get_view($options['view']);
// If view/view display isn't valid.
if (!$view || !isset($view->display[$options['display']])) {
watchdog(
'taxonomy_display',
'The view and/or display settings for %vocab are missing, go to the <a href="!link">full display page</a> and reconfigure the taxonomy term\'s associated content display.',
'The view and/or view display for %vocab is missing, go to the <a href="!link">full display page</a> and reconfigure the taxonomy term\'s associated content display.',
array(
'%vocab' => $term->vocabulary_machine_name,
'!link' => url('admin/structure/taxonomy/' . $term->vocabulary_machine_name . '/display/full'),
......@@ -41,10 +44,15 @@ class TaxonomyDisplayAssociatedDisplayHandlerViews extends TaxonomyDisplayAssoci
WATCHDOG_ERROR
);
}
else {
$build['view'] = array(
'#markup' => $embed_view,
);
// Else if the user has access to the view.
elseif ($view->access($options['display'])) {
// Generate the view's output.
$output = $view->preview($options['display'], $term->tid);
if ($output) {
$build['view'] = array(
'#markup' => $output,
);
}
}
return $build;
......@@ -111,10 +119,6 @@ class TaxonomyDisplayAssociatedDisplayHandlerViews extends TaxonomyDisplayAssoci
);
}
/**
* TODO: Add validate that ensures the display selected is part of the view, necessary for supporting no JS?
*/
/**
* We store values to access later for rendering and editing.
*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment