I ntoiced that the combo top (with the pipe symbol) lists each instance of a taxnomy term with the initial, and a count of one. If the itmes are repoeated, they simply recur, instead of being printed once with a correct count.

Here is a diff of code that makes it work as it should.

Not sure if this applies to the release version or not, and I didn;t realize until filling out this form that I had the alpha version.

In any case, it is at least a bug that is introduced in the current alpha version:

#diff views_bonus_summary_combo.module.save01 views_bonus_summary_combo.module
70a71,74
>
> $key = views_get_summary_link($view->argument[0]['type'], $node, $view->url);
> $barry[$key]++;
>
71a76
>
73c78,83
< return '

'. implode(' | ', $items) .'

';
---
> $result = '

';
> foreach ($barry as $key=> $item){
> $result .= $key . " ($item) | ";
> }
> $result .= "

";
> return $result;

Comments

digimedia’s picture

OK, I just checked, the released version has the same segment of code as the alpha version. so anyone reading this should probably make the changes above - hopefully the developers can incorporate it into a new release.

digimedia’s picture

Title: bug in display of combo top » bug in display of combo top and bottom

OK, now I saw that there was an issue with the way the bottom was displayed too - it was one line per Taxonomy term, and each line had a count of "(1)" nomatter what.

Below is a diff of the code that corrects boththe top and bottom issues.

I don't believe that this is properly themed, I leave that as an exercise to others, including the developers.

It looks like it is working for me for now.

You are welcome to use this code as you see fit.

# diff -b views_bonus_summary_combo.module.original views_bonus_summary_combo.module
38c38,52
< $bottom = theme('views_summary', $view, $type, $level, $nodes, $args);
---
> $initial = $view->args[0];
> foreach ($nodes as $node) {
> $key = views_get_summary_link($view->argument[0]['type'], $node, $view->url."/$initial");
> $barry[$key]++;
>
> }
>
> $bottom = '

    ';
    >
    > foreach ($barry as $key=> $item){
    > $bottom .= "
  • $key"." ($item) 
  • \n";
    > }
    > $bottom .= "

";
>
>
42a57
>
70a86,89
>
> $key = views_get_summary_link($view->argument[0]['type'], $node, $view->url);
> $barry[$key]++;
>
71a91
>
73c93,98
< return '

'. implode(' | ', $items) .'

';
---
> $result = '

';
> foreach ($barry as $key=> $item){
> $result .= $key . " ($item) | ";
> }
> $result .= "

";
> return $result;

brucealdridge’s picture

Category: support » bug

changed category....

jwilson3’s picture

These "patches" pasted into the text fields don't exactly copy well from the web.

For those who dont have a diff tool installed and want a quick fix, here:

replace:
$bottom = theme('views_summary', $view, $type, $level, $nodes, $args);
with:

    $initial = $view->args[0];
    foreach ($nodes as $node) {
      $key = views_get_summary_link($view->argument[0]['type'], $node, $view->url."/$initial");
      $barry[$key]++;
    }
    $bottom = '</p><ul>';
    foreach ($barry as $key=> $item){
      $bottom .= "<li>$key"."&nbsp;($item)&nbsp;</li>\n";
    }
    $bottom .= "</ul>
<p>";

replace:

function theme_views_bonus_summary_combo_top($view, $nodes) {
  
  drupal_add_css(drupal_get_path('module', 'views_bonus_summary_combo') .'/views_bonus.css');
  foreach ($nodes as $node) {
    $items[] = views_get_summary_link($view->argument[0]['type'], $node, $view->url)  . "&nbsp;(" . $node->num_nodes . ")&nbsp;| ";
  }
  ....


with

function theme_views_bonus_summary_combo_top($view, $nodes) {
  
  drupal_add_css(drupal_get_path('module', 'views_bonus_summary_combo') .'/views_bonus.css');
  foreach ($nodes as $node) {
    $key = views_get_summary_link($view->argument[0]['type'], $node, $view->url);
    $barry[$key]++;
    $items[] = views_get_summary_link($view->argument[0]['type'], $node, $view->url)  . "&nbsp;(" . $node->num_nodes . ")&nbsp;| ";
  }
  ....

replace:

   if ($items) {
    return '<div id="views_bonus_summary_top">'. implode(' | ', $items) .'</div>';
  }


with

   if ($items) {
    $result = '';
    foreach ($barry as $key=> $item){
      $result .= $key . " ($item) | ";
    }
    $result .= "";
     return '<div id="views_bonus_summary_top">'. $result .'</div>';
  }

pls, let me know if i posted an error here and will fix it.
[my-drupal.org-username] (at) gmail (dot) com

Would be really helpful if the owners would fix this so others don't download the same bugs.

dmitrig01’s picture

Status: Active » Fixed

I've fixed this.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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