the docs for user_save() should mention that $account is a pseudo-optional parameter, and can be either a valid $user object to work with an existing user, or an empty string to create a new user.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhodgdon’s picture

FileSize
1.28 KB

Here is a patch that clarifies the doc (for 7.x)

jhodgdon’s picture

Status: Active » Needs review
FileSize
1.06 KB

Here's a patch for 6.x too.

jhodgdon’s picture

I meant that second patch to have a .txt extension so it wouldn't automagically be applied. How can I change this or delete that attachment? Anyway, the doc sprint is wrapping up.

jhodgdon’s picture

Version: 6.x-dev » 7.x-dev

Changing this to 7.x, since it is a 7.x issue as well.

Status: Needs review » Needs work

The last submitted patch failed testing.

jhodgdon’s picture

FileSize
1.31 KB

Here's a new 7.x patch that should apply now. Will port to 6.x when it passes review.

jhodgdon’s picture

Status: Needs work » Needs review

Forgot to change status

Status: Needs review » Needs work

The last submitted patch failed testing.

lilou’s picture

Status: Needs work » Needs review

Setting to previous status - testbot was broken (failed to install).

Status: Needs review » Needs work

The last submitted patch failed testing.

jhodgdon’s picture

Status: Needs work » Needs review

Setting back to Needs Review in hopes that the patch will get retested. The test bot was apparently malfunctioning (I had about 7 patches fail in that time period, all were doc, none broke the HEAD install I am pretty sure).

moshe weitzman’s picture

Status: Needs review » Needs work

Seems like the $user->is_new == TRUE bit got cut. I am fond of that part.

jhodgdon’s picture

Status: Needs work » Needs review
FileSize
1.35 KB

Good point. How is this patch?

jhodgdon’s picture

FileSize
1.37 KB

Actually, I think this one is better.

moshe weitzman’s picture

The wording for $account is still confusing IMO.

jhodgdon’s picture

Status: Needs review » Needs work

OK. I'll give it another try on Monday. Brain rather fried today. Suggestions welcome. :)

jhodgdon’s picture

Status: Needs work » Needs review
FileSize
1.51 KB

How about this version?

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

WFM

webchick’s picture

Version: 7.x-dev » 6.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Committed to HEAD, thanks!

Needs backport to 6.x methinks. 6.x does not have that ->is_new parameter afaik, so that part should be dropped.

jhodgdon’s picture

Status: Patch (to be ported) » Needs review
FileSize
1.42 KB

Here is a patch for Drupal 6.

jhodgdon’s picture

FileSize
1.42 KB

Try this one. Typo in the first one.

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

This basically matches the D7 doc (except the parts that don't apply), so I'm just going to set this to RTBC.

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Needs work

I think this does not explain how can $account be omitted.

jhodgdon’s picture

Status: Needs work » Needs review
FileSize
1.46 KB

OK, how's this?

jhodgdon’s picture

bump. This patch still needs a review. I just noticed on another issue how bad the current doc is for user_save()... Can someone please review this? Thanks...

jn2’s picture

The content of the patch looks good to me (a big improvement over what's there now). The patch was created before the git conversion, so doesn't apply. I've re-rolled it.

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

OK, we have two +1 votes (mine and jn2) on the content of the patch -- thanks for the re-roll! Let's get this in.

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, committed.

Status: Fixed » Closed (fixed)

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