Active
Project:
Signup
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 May 2010 at 20:05 UTC
Updated:
27 May 2010 at 20:05 UTC
In signup_edit_form_save_submit(), the old signup object (stored in $form['#signup']) is assigned to the $signup variable, which in php5 assigns the object by reference. Then the $signup object is altered and saved, causing the object in $form['#signup'] to change.
This causes problems for submit handlers that require the old values of the signup object, most notably signup_status. In signup_status_alter_signup_edit_form_submit():
$signup = $form['#signup'];
if (isset($values['signup_status']) && $values['signup_status'] != $signup->status) {
the conditional will never pass.
A simple solution is to clone the object in signup_edit_form_save_submit():
$signup = clone $form['#signup'];
But this obviously only works for php5.