I'm using webform, webform_protected_downloads, webform_phone_number and webform_rules (versions below--all up to date). I just tested a webform I created, that has attached webform_protected_downloads files to it, and when I submit the form as an administrator, I get this error message:

Notice: Undefined index: webform in webform_rules_tokens() (line 213 of /www/sites/all/modules/webform_rules/webform_rules.module).
Warning: array_keys() expects parameter 1 to be array, null given in webform_rules_tokens() (line 213 of /www/sites/all/modules/webform_rules/webform_rules.module).
Warning: in_array() expects parameter 2 to be array, null given in webform_rules_tokens() (line 228 of /www/sites/all/modules/webform_rules/webform_rules.module).

I did a google search with no luck. Any suggestions? Thanks!

Webform 7.x-3.18
Webform Rules 7.x-1.5
Webform Protected Downloads 7.x-1.0-beta1
Webform Phone Number 7.x-1.11

Comments

cmejo’s picture

Status: Active » Fixed

I fixed it; I had a bad token in the webform_protected_downloads email text area field. Watch those tokens!

Status: Fixed » Closed (fixed)

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

viewattselevel’s picture

Can you tell me what you needed to do to the token and how you figured out that was what was breaking it?

cmejo’s picture

The tokens need to actually be valid. Make sure your tokens are valid. If they are verified valid and you're still getting this error, let me know.

n8thanael1900’s picture

I had inherited many tokens to check... to figure out the invalid token, I placed this code on line 213 inside webform_rules.module FOR TROUBLESHOOTING ONLY

if($data[$type]['components'] == null){
    $output = '<pre>token:' . print_r($tokens,true) . '</pre>';
    drupal_set_message($output, 'warning'); 
}