Closed (fixed)
Project:
Chaos Tool Suite (ctools)
Version:
7.x-1.0-rc1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Dec 2011 at 23:39 UTC
Updated:
31 Mar 2012 at 18:40 UTC
Jump to comment: Most recent file
Comments
Comment #1
summit commentedHi,
It only happens when I choose as a pane setting for the node being viewed terms pane:
- All vocabularies
If I choose, say the geographical vocaubulary the notice is not shown, and the terms are correctly output.
Greetings, Martijn
Comment #2
JamesAn commentedI can confirm this. The $terms array in ctools_node_terms_content_type_render() can be an array of strings or an array of term arrays (each array having a 3 element: title, href, and attributes).
Tracing the if statement, which constructs the $terms array, beginning on line 50, the $terms array is not an array of strings either if "all vocabularies" is selected or if the term formatting is selected as taxonomy links. The $terms array is correctly an array of link, which have those 3 elements when the formatting is taxonomy links as the theme('links') call uses these. In the other cases, the $terms array should be an array of strings.
Comment #3
JamesAn commentedI've created a patch that should fix this. Please review this.
The patch removes the separate logic used to generate the $terms array based on whether a vocabulary is selected or all vocabularies are included, since the $terms array structure should be the same regardless. Instead, if a vocabulary is selected, all terms not part of that vocabulary is simply excluded.
Comment #4
JamesAn commentedWe could also use EntityFieldQuery instead of taxonomy_term_load_multiple() and just add a propertyCondition('vid', $conf['vid']) before calling EntityFieldQuery::execute() if $conf['vid'] exists (i.e. a vocabulary is selected). This should be more efficient since irrelevant terms are not loaded (whereas currently all terms associated to the node are loaded and then filtered out).
Comment #5
merlinofchaos commentedI like this patch better: Can I get verification this works?
Comment #6
merlinofchaos commentedCommitted.