Getting this error after upgrading to PHP 5.3:

warning: call_user_func_array() expects parameter 2 to be array, string given in /cs/web/www-devel.cs.ubc.ca/docs/drupal/sites/all/modules/rules/rules/rules.module on line 851.

The second parameter has to be an array to work, but according to the PHP.net page it wasn't enforced until PHP5.3 - not sure what it did before, though, it must have tried *something* but what... ? To fix it, I typecast the $name variable string to array in rules_item_delete(), since there's only ever going to be one parameter per call (as far as I can tell). Patch attached.

Comments

Renee S’s picture

Component: Rules Core » Rules Engine
Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, rules.patch, failed testing.

Renee S’s picture

StatusFileSize
new575 bytes

D'oh.

Renee S’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, rules-878124.patch, failed testing.

Renee S’s picture

StatusFileSize
new514 bytes

Sigh.

Renee S’s picture

Status: Needs work » Needs review
StatusFileSize
new502 bytes

Crap.

fago’s picture

Status: Needs review » Fixed

thanks, I don't think this is the right fix though. I committed another one, please test.

Renee S’s picture

Typecasting (array)$var is equivalent to initializing array($var) :) Default setting on the argument'll catch any other instances, tho, I didn't think of that - works great. Thanks! :)

dspring0021’s picture

Pardon my ignorance, guys, but, so, which patch do we use and where can I find it?

Renee S’s picture

It's been fixed and committed to dev, dspring0021, just get the latest dev version and it should work fine. The patch is incomplete, don't use that :)

dspring0021’s picture

Thanks, renee. :-)

Status: Fixed » Closed (fixed)

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