does the function rules_condition_content_has_term() in taxonomy.rules.inc needs to handle the case where $taxonomy is an array of objects?

I just encountered this issue, and had to add the 3 lines marked with the "+" sign below.

if (!empty($vocab) && is_array($vocab)) {
  foreach ($vocab as $term) {
    $tid = is_object($term) ? $term->tid : (is_array($term) ? reset($term) : $term);
    $tids[$tid] = $tid;
  }
}
+ else if (!empty($vocab) && is_object($vocab)) {
+   $tids[$vocab->tid] = $vocab->tid;
+ }
else {
  if (!empty($vocab) && is_numeric($vocab)) {
    $tids[$vocab] = $vocab;
  }
}

I did not see an opened bug for this, and I also checked the 6.x-1.x-dev version.

Any one else experiencing this?

Comments

dblais’s picture

TR’s picture

Issue summary: View changes
Status: Active » Closed (outdated)