Commit 04c3d8a
committed
UR-4833: Fix membership not assigned and auto login not working
Fire user_registration_validate_form_data with do_action_ref_array() instead of
apply_filters_ref_array().
The hook passes &self::$valid_form_data by reference and its return value is
discarded, so it is an action in all but name. WP_Hook::apply_filters() does
$args[0] = $value before invoking each callback, and because $args[0] is a
reference to self::$valid_form_data, that assignment writes through the
reference. UR_Form_Validation::validate_form() is registered with add_action()
and has no return statement, so as soon as a second callback is attached to the
hook, $valid_form_data is overwritten with null and every submitted field is lost.
Consequences: user_login became empty and registration failed with
empty_user_login, and the membership field was gone so
process_membership_after_registration() silently skipped enrollment, leaving an
account with no plan, no order and no subscription. do_action_ref_array() sets
doing_action, which skips the $args[0] assignment, so nothing is lost.1 parent 902e10e commit 04c3d8a
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| |||
0 commit comments