Problem:
I'm getting wrong link after feature reverting (i.e. menutoken/563712aaa82e1). I've noticed that in menu_token_translated_menu_link_alter() we check if menu token is called from feature (i.e. _menu_token_is_called_from_features()). This function uses drupal static, which doesn't take into account a link and it will be executed once. Which means that in some cases manipulation with link in menu_token_translated_menu_link_alter() won't be executed. I think it can be an issue in some other situations (not only after feature reverting).
Solution:
We can take into account a link in _menu_token_is_called_from_features (i.e. use array for drupal static) or just move this piece of code:
if (!_menu_token_is_called_from_features()) {
return;
}
inside this condition:
if (empty($menu_admin) && isset($item['options']['menu_token_link_path'])) {
I think it will be enough. The patch is attached.
| Comment | File | Size | Author |
|---|---|---|---|
| menu_token-drupal_static_issue.patch | 665 bytes | alan-ps |
Comments
Comment #2
alan-ps commentedComment #3
pradeep22saini commented@alan-ps
I checked by reverting. It did fix my problem.
Patch is also applied cleanly for dev branch 7.x-1.x-dev.
Comment #5
develcuy commentedThanks for reporting @alan-ps and @pradeep22saini! Features support is now in good shape :D