Closed (fixed)
Project:
Custom Breadcrumbs
Version:
7.x-2.x-dev
Component:
custom_breadcrumbs
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Mar 2012 at 00:17 UTC
Updated:
9 Aug 2012 at 16:55 UTC
In playing around with the module, my log files have been filling up with some rather interesting errors:
Notice: Trying to get property of non-object in _custom_breadcrumbs_get_trail_items() (line 437 of /.../drupal/sites/all/modules/custom_breadcrumbs/custom_breadcrumbs.module).
The interesting nature of this problem seems to stem from a value being tested which does not exist. Having done an output from dd($breadcrumb, 'BREAD') I get this:
BREAD: stdClass Object
(
[bid] => 12
[name] => BC Trail
[titles] => n/a
[paths] => <url-path-trail>
[visibility_php] => return arg(3) == '' ? TRUE:FALSE;
[specific_path] => my-path/*
[language] => en
[breadcrumb_type] => path
)
BREAD: Array
(
)
BREAD: Array
(
)
In source, I see the following function trying to set a value:
$options = _custom_breadcrumbs_identifiers_option($i + 1, $breadcrumb->bid);
Here is a suggested patch to avoid this unwanted result.
| Comment | File | Size | Author |
|---|---|---|---|
| _custom_breadcrumbs_get_trail_items.patch | 1012 bytes | wilco |
Comments
Comment #1
tarmstrong commentedI had this same error message, but it was showing up because a custom module was passing in an array to
_custom_breadcrumbs_get_trail_items():I managed to fix the error without hacking custom_breadcrumbs with the following change to the custom code:
This works because
_custom_breadcrumbs_identifiers_option()just needs something passed as thebidargument, but does nothing with it.Do you have custom code passing blank arrays into
_custom_breadcrumbs_get_trail_items()?Comment #2
wilco commentedThank you for your reply tarmstrong.
That makes sense. In reviewing a custom module, I did in fact find exactly what you noted above.
This sort of edit should exist in the notes of the module.
Cheers.
Comment #3
wilco commentedComment #3.0
wilco commentedCorrects a typo in the content.