My bugfix

function _custom_breadcrumbs_load_for_type($node) {
  $sql = "SELECT * FROM {custom_breadcrumb} WHERE node_type = '%s'";
  $result = db_query($sql, $node->type);
  while ($breadcrumb = db_fetch_object($result)) {
    if (!empty($breadcrumb->visibility_php)) {
      // Use PHP code to check the visibility.
      ob_start();
      //$result = eval(trim($breadcrumb->visibility_php)); commented by GROL 
      $visibility = eval(trim($breadcrumb->visibility_php));
      ob_end_clean();
      if ($visibility == TRUE) {
	      return $breadcrumb;
      }
    }
    else {
      return $breadcrumb;
    }
  }
}
CommentFileSizeAuthor
#1 custom_breadcrumbs_visibility_check.patch822 bytesAnonymous (not verified)

Comments

Anonymous’s picture

Status: Active » Needs review
StatusFileSize
new822 bytes

thumbs up. the error is that $result is the db_query resource it's looping through, and if there's a PHP visibility to evaluate, that result is also put into $result.

motto’s picture

Good job! This fix works fine for me.

MGN’s picture

Status: Needs review » Reviewed & tested by the community

Patch works fine. I've tested it and have been using it for am using it for a couple of weeks now...no problems.

thepanz’s picture

Manual edited .module file with your patch. Works fine.

scottrigby’s picture

perfect - this is great - any chance of getting into the next release? :)

MGN’s picture

Version: 6.x-1.3 » 6.x-1.x-dev
Status: Reviewed & tested by the community » Fixed

Committed to 6.x-1.x-dev.

Status: Fixed » Closed (fixed)

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

datawench’s picture

Priority: Critical » Minor

Apparently this didn't make it into 6x-1.4?

MGN’s picture

Look at the dates of the releases. 6.x-1.4 is older than 6.x-1.x-dev. The latest release will always be the developmental release. I am waiting on #334324: Menu active trail query to be resolved before releasing the next stable version (6.x-1.5).