Project:Custom breadcrumbs
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:minor
Assigned:GROL
Status:closed (fixed)

Issue Summary

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;
    }
  }
}

Comments

#1

Status:active» needs review

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.

AttachmentSize
custom_breadcrumbs_visibility_check.patch 822 bytes

#2

Good job! This fix works fine for me.

#3

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.

#4

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

#5

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

#6

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

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

#7

Status:fixed» closed (fixed)

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

#8

Priority:critical» minor

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

#9

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).

nobody click here