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;
}
}
}
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | custom_breadcrumbs_visibility_check.patch | 822 bytes | Anonymous (not verified) |
Comments
Comment #1
Anonymous (not verified) commentedthumbs 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.
Comment #2
motto commentedGood job! This fix works fine for me.
Comment #3
MGN commentedPatch works fine. I've tested it and have been using it for am using it for a couple of weeks now...no problems.
Comment #4
thepanz commentedManual edited .module file with your patch. Works fine.
Comment #5
scottrigbyperfect - this is great - any chance of getting into the next release? :)
Comment #6
MGN commentedCommitted to 6.x-1.x-dev.
Comment #8
datawench commentedApparently this didn't make it into 6x-1.4?
Comment #9
MGN commentedLook 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).