API page: http://api.drupal.org/api/drupal/modules%21user%21user.module/function/u...

Enter a descriptive title (above) relating to function user_login_finalize, then describe the problem you have found:

user_login_finalize() has an $edit parameter which has no documentation.

(Not tagging as Novice, as the callers to this function appear inconsistent. You have to go looking at http://api.drupal.org/api/drupal/modules!user!user.api.php/function/hook... to see what's expected.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhodgdon’s picture

Issue tags: +Novice

What is passed in is the $form_state array from the user login form, if the user login form was being used, but it's optional (several of the calling functions do not pass this parameter in, since they do not use the user login form).

I think that would be OK for a novice project to add this to the documentation. We should also add a note to the hook_user_login() docs to say that $edit could be an empty array if the user login form is not the mechanism being used to log in the user.

joachim’s picture

Issue tags: -Novice

> What is passed in is the $form_state array from the user login form, if the user login form was being used, but it's optional (several of the calling functions do not pass this parameter in, since they do not use the user login form).

Is that definitely correct?

The docs for hook_user_login() say:

> $edit: The array of form values submitted by the user.

Therefore, I was taking this to mean that there is a bug in two of the callers to this, which ought to pass their $form_state, but do not.

joachim’s picture

Issue tags: +Novice

Oops.

joachim’s picture

Bug filed for the missing param in the calls to this: #1967492: user_login_finalize() is called incorrectly.

markpavlitski’s picture

Status: Active » Needs review
FileSize
929 bytes

Patch for the documentation change.

jhodgdon’s picture

Assigned: Unassigned » jhodgdon
Status: Needs review » Reviewed & tested by the community

Looks good, thanks! I'll get this committed soon.

jhodgdon’s picture

Assigned: jhodgdon » Unassigned
Status: Reviewed & tested by the community » Fixed

Thanks again! Committed to 8.x and 7.x.

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