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.

AttachmentSize
tagadelic_views.patch639 bytes

Comments

#1

Version:5.x-1.x-dev» 6.x-1.x-dev

Good Catch gustav. Has anyone else reviewed this patch?

#2

Version:6.x-1.x-dev» 6.x-1.1

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

Assigned to:Anonymous» anrikun

Here's the patch applied to 6.x-1.1's theme/theme.inc to fix the bug.

AttachmentSize
theme.inc.patch 801 bytes

#4

Patch from #3 works for me against 6.x-1.1. Thanks!

#5

Status:needs review» reviewed & tested by the community

#6

Status:reviewed & tested by the community» fixed

Commited

http://drupal.org/cvs?commit=383592

#7

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here