Closed (duplicate)
Project:
Drupal core
Version:
5.x-dev
Component:
taxonomy.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Feb 2007 at 21:44 UTC
Updated:
21 Jul 2007 at 01:02 UTC
Jump to comment: Most recent file
Comments
Comment #1
zonker commentedAgreed - this is a really annoying problem with a very simple fix. I found the same problem in 4.7 and came up with much the same fix (before finding this issue node).
The issue is that taxonomy_form_all only returns categories which have two or more terms in them. This is clearly incorrect behaviour, and the function should return categories which also have just a single term.
Patch for 4.7 attached. The exact equivalent applies to 5.x.
Nick
Comment #2
RobRoy commentedDon't even need that in there. See http://us2.php.net/manual/en/language.types.boolean.php#language.types.b.... An empty array results in false and since taxonomy_get_tree always returns an array we can just do this. (We could do if ($tree = taxonomy_get_tree($vid))) but I like this better.
Comment #3
litwol commentedi do not agree with you. by some freak of nature bug $tree might become a positive number that will result this conditional statememt to evaluate to true. this is a potential door to another bug.
Comment #4
RobRoy commentedNo. Heh, have you looked at taxonomy_get_tree()? It will always be an array. Trust me.
Comment #5
drummAlready fixed by http://drupal.org/node/107822.