taxonomy_get_tree().

In the foreach loop the following statement is being executed during every run. It should be placed right after $max_depth is being calculated.
if ($max_depth > $depth) {

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Xano’s picture

Kick.

JeremyFrench’s picture

Assigned: Unassigned » JeremyFrench
Status: Active » Needs review
FileSize
1.48 KB

Changed this and also put the two ifs outside the loop into one patch uploaded

Damien Tournoud’s picture

Status: Needs review » Needs work

Oh my, yes! ;)

Thanks for the patch.

A minor point:

+  if ($max_depth > $depth and !empty($children[$vid][$parent])) {

By convention, we use && instead of and, and we encourage "to always use curly braces even in situations where they are technically optional, as it increases readability and decreases the likelihood of logic errors".

JeremyFrench’s picture

Status: Needs work » Needs review
FileSize
1.48 KB

I have changed the "and" to "&&" but I am not sure where I have missed out a curly brace, should I split the if into to statements?

Anonymous’s picture

Status: Needs review » Reviewed & tested by the community

Let's get this one in.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

andypost’s picture

Version: 7.x-dev » 6.x-dev
Status: Fixed » Patch (to be ported)
FileSize
1.49 KB

Suppose this one should be ported

andypost’s picture

Issue tags: +Quick fix

Just a tag

brianV’s picture

Status: Patch (to be ported) » Reviewed & tested by the community

Port looks good. Setting to RTBC to be committed.

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Committed to Drupal 6, thanks.

Status: Fixed » Closed (fixed)
Issue tags: -Quick fix

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