warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /sites/all/modules/role_expire/role_expire.module on line 297.
Hello,
I am getting the above error message when creating a new user via Rules, without using Role Expire module at all.
I have not defined any default expiration values, perhaps that is the issue.
I have not yet found why exactly, but I thought it is better to report it, perhaps others see this as well.
Comments
Comment #1
stewsnoozeWhat URL are you on in Rules and what steps do you take to get it? For instance have you created a specific rule to create a user?
Comment #2
giorgio79 commentedYes, I created a rule, that creates a user in certain cases (here is the module that does it http://www.drupal.org/project/clickbank_ipn)
This happens after the rule is executed and the user is created fine.
The user is created as expected.
Comment #3
eg208 commentedI am getting this error too when create account using facebook oauth http://drupal.org/project/fboauth
warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/xxx/public_html/sites/all/modules/role_expire/role_expire.module on line 383.
Comment #4
stewsnoozeThis should be raised in its own issue. It shouldn't be out on the end of this one. Also you really should try this action without the other module turned on before you add the issue as even though the error appears to be in role expire it could be the other module wrecking the data before role expire gets it
Comment #5
travisjbennett commentedGood to know I'm not alone!
My error message was a bit different due to my use of a newer version of PHP: "warning: array_key_exists() expects parameter 2 to be array, null given in
/(...)/www/sites/all/modules/role_expire/role_expire.module
on line 303.
(Shown 8 times)
I can confirm this is a bug whenever programmatically creating users, especially without roles right-off-the-bat.
My fix is below, to just replace null with an empty array via an if / elseif statement.
I don't know how to role a patch, and don't use Drupal 7 much, so my solution is all I can provide. Can I get a reviewer?
Drupal 6: Starting around line 301 of role_expire.module,v 1.22 2010/06/20 20:47:16
Thanks!
Comment #6
rcodinaDrupal 6 version is unsupported!