Posted by gustav on January 30, 2009 at 12:31pm
| Project: | Views Tagadelic |
| Version: | 6.x-1.1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | anrikun |
| Status: | closed (fixed) |
Issue Summary
The views module allows empty blocks to be hidden altogether. Unfortunately that did not work with tagadelic blocks because even if none of the nodes had tags, the nodes would still be listed in $view->result. This keeps the views module from noticing that the block is empty (see http://drupal.org/node/332762). This patch fixes that by clearing the $view->result array when the block is empty.
This patch is for version 6.x-1, but the issue tracker did not allow me to select that version, hence this issue is incorrectly labelled as 5.x-1.x-dev.
| Attachment | Size |
|---|---|
| tagadelic_views.patch | 639 bytes |
Comments
#1
Good Catch gustav. Has anyone else reviewed this patch?
#2
This patch works but it seems to have been badly committed into 6.x-1.1
From line 49 in theme.inc, instead of:
<?php$tags = tagadelic_build_weighted_tags($result, $options['steps']);
$tags = tagadelic_sort_tags($tags);
if (!empty($vars['output'])) {
$view->result= NULL;
}
$vars['output'] = theme('tagadelic_weighted', $tags);
?>
It should be:
<?php$tags = tagadelic_build_weighted_tags($result, $options['steps']);
$tags = tagadelic_sort_tags($tags);
$vars['output'] = theme('tagadelic_weighted', $tags);
if (empty($vars['output'])) {
$view->result = NULL;
}
?>
Because of that, the same bug still occurs in 6.x-1.1.
#3
Here's the patch applied to 6.x-1.1's theme/theme.inc to fix the bug.
#4
Patch from #3 works for me against 6.x-1.1. Thanks!
#5
#6
Commited
http://drupal.org/cvs?commit=383592
#7
Automatically closed -- issue fixed for 2 weeks with no activity.