Only first row checked
GROL - August 16, 2008 - 19:17
| Project: | Custom Breadcrumbs |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | minor |
| Assigned: | GROL |
| Status: | closed |
Description
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;
}
}
}
#1
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.
#2
Good job! This fix works fine for me.
#3
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
Committed to 6.x-1.x-dev.
#7
Automatically closed -- issue fixed for 2 weeks with no activity.
#8
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).