With role_change_modify module enabled, when I change a role for a user, the role_change_notify_user_update() function do a hook call via module_invoke_all() with improper arguments order which make some hooked module fail with a Cannot use object of type stdClass as array exception.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rfay’s picture

Version: 6.x-2.1 » 6.x-2.x-dev
FileSize
4.83 KB

And how right you are.... But it goes beyond that. Why did the hook need to be invoked in the first place. This patch removes the hook invocation and cleans up token handling. It was not pretty in there.

I'd appreciate your review and testing on this. I think I'll spend the rest of the day getting D6 tests ready for this.

rfay’s picture

Found yet another bug... But it was writing the test that flushed it out :-)

rfay’s picture

Title: Cannot use object of type stdClass as array » Cannot use object of type stdClass as array, Remove extra hook invocation
Status: Needs review » Fixed

Committed to DRUPAL-6--2: http://drupal.org/cvs?commit=339520

This one will deserve a release, as this is a severe bug that heltem has caught.

@heltem: If you can try this out and report back it will be much appreciated. Will be in the next dev.

heltem’s picture

Applied your patch.
Tried.
Looks good.
Thank you.

rfay’s picture

Thank *you*. You're turning in to an excellent contributor.

Status: Fixed » Closed (fixed)

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