Not sure if this is "by design," but should custom_breadcrumbs_unique_breadcrumb_id() return a value even when breadcrumb visibility with PHP evaluates to false?

Comments

gg4’s picture

Sort of related.

Note that this code has access to the $node variable, and can check its type or any other property.

This code works in my node.tpl.php files, but doesn't seem to evaluate correctly when using Breadcrumb visibility with PHP. Should I be accessing the $node object in some other way?

$node->field_item_type[0]['value'] != '456' ? return TRUE : return FALSE ;

MGN’s picture

Component: Documentation » Code
Category: support » bug

should custom_breadcrumbs_unique_breadcrumb_id() return a value even when breadcrumb visibility with PHP evaluates to false

In the current code, this function sets the unique breadcrumb id when the breadcrumb is set (i.e. visibility is TRUE). This function also returns the id that was set last during the page request. So it should not return a value if a custom breadcrumb has not been set. But looking at the code now, I see that it would return a value - so this is a bug.

I think your code snippet is fine. Just to check, are you including the php tags in the breadcrumb visibility field? Php tags should not be included in this field (they are assumed).

MGN’s picture

Status: Active » Fixed

I've committed a change to 6.x-2.x-dev. Hopefully that will resolve this issue. But if not, please provide details regarding the type of breadcrumb and the circumstance when the problem occurs.

Marking as fixed for now, but reopen if you are still seeing problems with this in the latest code. Thanks.

Status: Fixed » Closed (fixed)

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