When signups have been opened with signup_open_signup(), that function's call to node_load() causes static caching of the node object prior to the status being updated, so when subsequently signup_sign_up_user() does a node_load() it gets the cached node, and the check of $node->signup_status fails, resulting in the user not being signed up and drupal_access_denied() being called.

This can be a problem if you attempt to programmatically open signups (signup_open_signup()), and then signup a user (signup_sign_up_user()).

CommentFileSizeAuthor
#1 signup-670944-1.patch1.5 KBmlsamuelson

Comments

mlsamuelson’s picture

Status: Active » Needs review
StatusFileSize
new1.5 KB

Patch attached. It adds an optional parameter to signup_sign_up_user() that allows for node_load() to be called with the reset parameter as TRUE. Pretty straightforward.

In the meanwhile, until this patch is applied, calling node_load() with the reset as TRUE after signup_open_signup() but before signup_sign_up_user() in one's code works as a workaround.

One could make the argument that the workaround is the way to go here, but because of the obscurity of the issue, I think it's better to have it handled via signup_sign_up_user() and thus included in the module itself, rather than in related code.

Cheers.

ezra-g’s picture

Status: Needs review » Fixed

This seems reasonable to me. Thanks for the patch including updated function documentation. Committed.

Thanks!
http://drupal.org/cvs?commit=470444

Status: Fixed » Closed (fixed)

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