Wether the box is checked or not, it appears as though 'these terms' are always included as candidates. This patch fixes that bug.

Comments

chris matthews’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Needs reroll

The 5 year old initial patch to term_has_parent.inc does not apply to the latest ctools 7.x-1.x-dev and needs a reroll.

Checking patch plugins/access/term_has_parent.inc...
error: while searching for:
  }
  $vid = $conf['vid'];

  // we'll start looking up the hierarchy from our context term id.
  $current_term = $context->data->tid;

  $term='';

  // scan up the tree.
  while (true) {
    // select parent as term_parent to avoid PHP5 complications with the parent keyword
    //@todo: Find a way to reduce the number of queries required for really deep hierarchies.
    $term = db_query("SELECT parent AS term_parent, tid AS tid FROM {taxonomy_term_hierarchy} th WHERE th.tid = :tid", array(':tid'=>$current_term))->fetchObject();

    // if no term is found, get out of the loop
    if (!$term || empty($term->tid)) {
      break;
    }

    // check the term selected, if the user asked it to.
    if (!empty($conf['include_self']) && isset($conf['vid_' . $vid][$term->tid])) {
      return TRUE;
    }

    // did we find the parent TID we were looking for?
    if (isset($conf['vid_' . $vid][$term->tid])) {
      // YES, we're done!
      return TRUE;
    }

error: patch failed: plugins/access/term_has_parent.inc:113
error: plugins/access/term_has_parent.inc: patch does not apply
andrew answer’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new1.94 KB

Patch rerolled.

japerry’s picture

Status: Needs review » Closed (outdated)

Drupal 7 is no longer supported, closing.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.