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!!!

CommentFileSizeAuthor
#13 1160926-blog-module-path-conflict.patch1008 bytesklokie

Comments

Kunani’s picture

Another 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).

ndewhurst’s picture

FWIW, 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)...

lOggOl’s picture

I 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:

  elseif ($root_path == 'blog/%' && isset($router_item['page_arguments'][0]->uid) && $router_item['page_arguments'][0]->uid == $user->uid) {

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

dealancer’s picture

adding tag

dealancer’s picture

Status: Active » Postponed (maintainer needs more info)

I 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.

develcuy’s picture

Version: 7.x-1.0-alpha1 » 7.x-1.x-dev
Status: Postponed (maintainer needs more info) » Closed (duplicate)
ekidman’s picture

The fix in #3 worked for me. Thanks.

seren10pity13’s picture

Issue summary: View changes

Can't believe that this bug is still here 3 years later !
The fix in #3 worked for me too. Thanks.

Anonymous’s picture

This 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 ?

develcuy’s picture

Title: Context Breadcrumb and Menu Token Issue » Blog module misscheking conflicts with Menu Token module
Project: Menu Token » Drupal core
Version: 7.x-1.x-dev » 7.x-dev
Component: Miscellaneous » blog.module
Status: Closed (duplicate) » Active
dcam’s picture

klokie’s picture

Title: Blog module misscheking conflicts with Menu Token module » Blog module conflicts with other URL routes beginning with "blog/"
klokie’s picture

Status: Active » Needs review
StatusFileSize
new1008 bytes

The attached patch should clear up the notice.

klokie’s picture

Status: Needs review » Reviewed & tested by the community
cilefen’s picture

Status: Reviewed & tested by the community » Needs review
Issue tags: -menu module interaction

@klokie I like the enthusiasm but it needs peer review.

fabianx’s picture

Status: Needs review » Closed (duplicate)

Even 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/".