Problem/Motivation

If someone attempts to register on a slave site (i.e. no user account on the master either), then the only form values passed to the master are the four in $allowed = array('name', 'mail', 'pass', 'timezone');. The end result is the user account on each site omits all other values submitted on registration. So, if a user wants to update their account, e.g. to set the password after using the one-time login link, then they need to re-enter all of the form values included on registration. On each site, potentially.

This practice seems a bit self-defeating in light of issues like #556666: Sync hooks: Enable sharing of arbitrary data dealing with data syncing to the slave sites when user account is updated on the master.

Proposed resolution

Allow all form values to be sent to the master AND to be returned to the slave (if the slave requires email validation so that an account will also be established on the slave)? The form values will automatically be included in the calls to user_save().

Remaining tasks

Review, write tests, update documentation.

User interface changes

None, except that registration form values will show up on each site when viewing a user account.

API changes

None.

#1954462: Support extra query arguments along with query destination and during registration
- this adds a special exception to send and return the query argument in the oatmeal cookie
- this seems very similar to sending all the form values on registration, as proposed here
#556666: Sync hooks: Enable sharing of arbitrary data

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

solotandem’s picture

Status: Active » Needs review
FileSize
2.49 KB

Patch implements proposed resolution and also fixes some whitespace issues.

In bakery_register_return(), setting of $new could be changed to match style used in bakery_register() which sets individual items in the $userinfo array instead of all at once. For example:

  $userinfo['name'] = $name;
  $userinfo['mail'] = $mail;

as opposed to:

$new += array(
  'name' => $cookie['name'],
  'mail' => $cookie['data']['mail'],
);
solotandem’s picture

Patch in #1 leaves the uid from master in the cookie returned to slave. This means slave tries to save user with the same uid, which may fail.

Attached patch fixes this.

solotandem’s picture

Issue summary: View changes

Rephrase and reorganize.

caschbre’s picture

I'm working on a project where we want similar functionality, however we don't want to pass just anything on the registration form. Attached is a patch that filters based on the supported fields.

caschbre’s picture

The array_merge in #3 wasn't quite working right. Here's an update to that.

caschbre’s picture

After some more testing, the array merge wasn't working in all cases. So here's a fix that doesn't try to do an array_merge.

ckng’s picture

Initial test with path #5 is working.