This is one of those cases where the problem isn't really in this module, but I feel like it is Token's responsibility. When Flag, Token, and XMLSitemap Menu are all enabled, there is an undefined index of 'token type' on line 88 of flag.tokens.inc, in flag_tokens_info(). token_entity_info_alter() is supposed to put that key in the entity info, so I started trying to figure out which entity type was broken. It turns out that it's "menu_link", which is a type added by xmlsitemap_menu_entity_info_alter(). Naturally, token_entity_info_alter() runs before xmlsitemap_menu, and it's definition of menu_link doesn't include a 'token type' key.

Now, any of these modules could be patched to fix this problem, but I feel that if Token is going to try to add this key to some entity types, it ought to try to do them all. And the obvious solution to that is to make its implementation of hook_entity_info_alter() be last in line.

CommentFileSizeAuthor
token_entity_info_alter.patch503 bytesIsland Usurper
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Agileware’s picture

Status: Active » Needs review

Works for me.

Setting issue status to needs review for the patch.

pog21’s picture

I was about to apply this patch, but disabling/re-enabling the xmlsitemap module fixed it for me.

Dave Reid’s picture

Status: Needs review » Closed (duplicate)

This is a duplicate #2223911: xmlsitemap_menu.module uses hook_entity_info_alter(), and so doesn't get a token type set by token module. Just update to the latest version of XML sitemap.

This is an alter hook, all the entity types are supposed to be there, so I don't really think we need to re-order this, but XML sitemap is a special case.