The function _omniture_get_token_context() calls functions defined in menu.module and this creates a dependency with menu.

This patch adds that as an explicit dependency.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bleen’s picture

Nice catch ... one thought though. Is it preferable to add this dependency or to add a if(module_exists('menu')){...} to the token context code?

lucascaro’s picture

good point. module_exists makes sense, that way we can still provide contexts for nodes and taxonomies if menu is not enabled... I can post another patch if it helps.

lucascaro’s picture

this one should do

bleen’s picture

Status: Needs review » Needs work

what about all the token tree form elements like this:

$form['advanced']['tokens'] = array(
    '#theme' => 'token_tree',
    '#token_types' => array('node', 'menu', 'term', 'user'),
    '#global_types' => TRUE,
    '#click_insert' => TRUE,
  );

Maybe we need a function to abstract "token type" as well?

lucascaro’s picture

Status: Needs work » Needs review

@bleen18 that is showing the available tokens and if the menu module is not enabled it will not show tokens for menus, so that shouldn't be a problem.

That's the only other reference to the menu module in omniture so the patch should work as it is (unless it's too old, so I'll re-test it just in case :D )

lucascaro’s picture

bleen’s picture

Title: Add menu as a dependency » Error if menu module is disabled
Status: Needs review » Closed (fixed)

Good enough for me: committed ... thanks!!

@lucascaro: if you have a second, I'd love to get some other opinions on: #1856722: Create an official release for 7.x ...

bleen’s picture

Status: Closed (fixed) » Fixed
lucascaro’s picture

awesome, and done :)

Status: Fixed » Closed (fixed)

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