Warning: array_intersect() [function.array-intersect]: Argument #2 is not an array in commerce_email_preprocess_token_tree() (line 120 of /home/artfo/public_html/dl7/sites/all/modules/commerce_email/commerce_email.module).

i'm getting the above warning on the custom breadcrumbs admin interface and certain breadcrumbs have stopped working. Any help or hints would be great thanks.

Comments

drupalsteve’s picture

I'm seeing the same error.

dgastudio’s picture

same here on visit

/admin/help/token

loko’s picture

Same error here.

dave reid’s picture

I dunno why the heck this module is doing this preprocess, which it's not clearly related to the feature of this module and other modules like Token tweak are the proper place for modifying the default recursion limit.

paul.linney’s picture

Status: Active » Closed (cannot reproduce)

Can't reproduce.
The module has never had a commerce_email_preprocess_token_tree call in it.

Re-open if you have more info.

Paul

jamestombs’s picture

Issue summary: View changes
Status: Closed (cannot reproduce) » Active

Still an issue in the latest 1.x-dev release.

Not sure if it needs to be there but can be fixed by updating to:

function commerce_email_preprocess_token_tree(&$variables) {
  if (isset($variables['token_types']) && is_array($variables['token_types'])) {
    if (array_intersect(array('node', 'user'), $variables['token_types'])) {
      $variables['recursion_limit'] = 2;
    }
  }
}

Adds a check to see if $variables['token_types'] is set and if it is, is an array. If not then we don't do anything.

brtamas’s picture

Here is a patch.

Anonymous’s picture

THank you patch in #7 is still relevant and a welcome solution

rszrama’s picture

Status: Active » Closed (outdated)