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.

CommentFileSizeAuthor
menu_token-drupal_static_issue.patch665 bytesalan-ps
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alan-ps created an issue. See original summary.

alan-ps’s picture

Issue summary: View changes
pradeep22saini’s picture

Status: Needs review » Reviewed & tested by the community

@alan-ps
I checked by reverting. It did fix my problem.

Patch is also applied cleanly for dev branch 7.x-1.x-dev.

  • develCuy committed 0aec3ec on 7.x-1.x authored by alan-ps
    Issue #2803729 by alan-ps, pradeep22saini: Menu token link becomes...
DevElCuy’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for reporting @alan-ps and @pradeep22saini! Features support is now in good shape :D

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.