Used Menu token on a couple menu items, specifically blog/[current-user:uid] to view the current users blog posts. I also use a Panel for the blog node which requires me to use context to place a proper breadcrumb on the panel display.
If I setup a context to look for a path and then breadcrumb using the menu item a 'menu token' is active in, the breadcrumb never displays. If I point the context reaction to a static menu item (tokens not active) it works fine and displays my crumb.
This is the error showing in my logs when I try to visit my blog panel page with the context for the breadcrumb pointing to a menu token active menu item:
Notice: Undefined index: und in ctools_entity_from_field_context() (line 91 of /var/www/MYSITE/sites/all/modules/ctools/plugins/relationships/entity_from_field.inc).
Any help or pointer to a fix would be appreciated! Great module!!!
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | 1160926-blog-module-path-conflict.patch | 1008 bytes | klokie |
Comments
Comment #1
Kunani commentedAnother in the log just previous to that:
Notice: Trying to get property of non-object in blog_menu_local_tasks_alter() (line 154 of /var/www/MYSITE/modules/blog/blog.module).
Comment #2
ndewhurstFWIW, I have the same issue with Views in D7 when using a token to override a view title and breadcrumb, where the token is derived from a contextual filter (URL argument) and represents the content author's uid. In my case, the token is inserted correctly, but I encounter a notice identical to that quoted here (in comment #1)...
Comment #3
lOggOl commentedI had the same problem after installing the Token module. This is a definite bug in the blog.module file, but it is easily fixed following these directions:
1. Go to the file blog.module and find the line (154 or 155) in the function blog_menu_local_tasks_alter().
2. The line should be:
elseif ($root_path == 'blog/%' && $router_item['page_arguments'][0]->uid == $user->uid) {3. Change it to:
4. The warning is now fixed.
Why is this happening?
Tokens changed the property object (array in this case) $router_item['page_arguments'].
It no longer holds the user's uid at location 0, so the value $router_item['page_arguments'][0]->uid is NULL.
NJoy
Comment #4
dealancer commentedadding tag
Comment #5
dealancer commentedI feel like I now the reason of the issue, but I can't reproduce one.
Please write step by step manual of what I need to do to reproduce it.
Comment #6
develcuy commented#1504110: Fetch objects from ctools context instead of <entity>_load()
Comment #7
ekidman commentedThe fix in #3 worked for me. Thanks.
Comment #8
seren10pity13 commentedCan't believe that this bug is still here 3 years later !
The fix in #3 worked for me too. Thanks.
Comment #9
Anonymous (not verified) commentedThis issue still persists in the latest version 7.35-dev.
The fix in #3 by lOggOl worked.
Why hasn't this been fixed in the release yet ?
Comment #10
develcuy commentedComment #11
dcam commentedComment #12
klokie commentedComment #13
klokie commentedThe attached patch should clear up the notice.
Comment #15
klokie commentedComment #16
cilefen commented@klokie I like the enthusiasm but it needs peer review.
Comment #17
fabianx commentedEven though this one is older, the other one has the RTBC.
Closing this one in favour of #1388664: Blog module conflicts with other URL routes beginning with "blog/".