Hi there, and thanks for your great module.

I think I found a bug : When a recipe have several taxonomy term, on the summary table, it show only one taxonomy term.

How can I fix this problem ? Thanks

(lets see my screenshot to see the problem)

thanks

zmove

Comments

brdwor’s picture

Here is the code that creates the summary table:

  $vocabs = taxonomy_get_vocabularies('recipe');
  if (count($vocabs) > 0) {
    foreach ($vocabs as $vocab) {
      $terms = taxonomy_node_get_terms_by_vocabulary($node->nid, $vocab->vid);
      if (count($terms) > 0) {
        $term = array_shift($terms);
        $summary .= '<tr><th>'.$vocab->name.'</th><td>'.l($term->name, 'taxonomy/term/'.$term->tid).'</td></tr>';
      }
    }

The summary table should list all terms under the 'recipe' taxonomy. If this doesn't answer your question, could you post a picture of the 'edit node' showing how you are selecting the terms?

zmove’s picture

StatusFileSize
new7.23 KB

Here is a screen of my taxonomy selection.

It's a simple hierarchical taxonomy with 2 parents : 'type d'envies' and 'type de plat' which have childrens.

As you can see, I selected 2 terms : 'sans gluten' and 'vegetarien' which are children of 'type d'envie' and, as my previous screen show it, the summary table only show the 'vegetarien' term.

zmove’s picture

No solution or my screenshot is bad ?

grudolf’s picture

Status: Active » Needs review
StatusFileSize
new1.02 KB

The summary table lists all applied taxonomy categories and the first item of each category. To list all the items replace

        $term = array_shift($terms);
        $summary .= '<tr><th>'.$vocab->name.'</th><td>'.l($term->name, 'taxonomy/term/'.$term->tid).'</td></tr>'; 

with

        $summary .= '<tr><th>'.$vocab->name.'</th><td>';
        foreach ($terms as $term) {
                $summary .= l($term->name, 'taxonomy/term/'.$term->tid).' ';
        }
        $summary .= '</td></tr>'; 

I'm attaching the patch file, please review.

zmove’s picture

It works perfectly, big thanks !!!!

I will continue testing and I will say to you if I have a problem.

Thanks again

brdwor’s picture

Status: Needs review » Fixed

This has been committed to HEAD for some time now.

brdwor’s picture

Version: 5.x-1.x-dev » 6.x-1.x-dev
Status: Fixed » Postponed (maintainer needs more info)

Can someone confirm if this occurs under 6.x? The 6.x code does not seem to include this fix.

DomeMinion’s picture

StatusFileSize
new29.51 KB

This problem occurs in 6.x when running recipe 6.x-1.0-beta1.

I tried the patch listed above which I assume was written for 5.x. It did not work for me but I'm not much of a php programmer. After the patch the taxonomy display disappeared. Remove the patch and only one of multiple selections is displayed.

jvandervort’s picture

Version: 6.x-1.x-dev » 6.x-1.0-beta1
Component: Miscellaneous » Code
Assigned: Unassigned » jvandervort
Status: Postponed (maintainer needs more info) » Fixed

Fixed in the 6.x-dev nightly snapshot (Feb 10).

Status: Fixed » Closed (fixed)

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