API page: https://api.drupal.org/api/drupal/core%21modules%21user%21user.module/fu...

The code contains the following lines.

  // Remove password and session IDs, $form_state, since themes should not need nor see them.
  unset($variables['user']->pass, $variables['user']->sid, $variables['user']->ssid);

The comment is wrong, since the code is not unsetting any $form_state. It is just unsetting password and session IDs.

  // Remove password and session IDs, since themes should not need nor see them.
  unset($variables['user']->pass, $variables['user']->sid, $variables['user']->ssid);
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kiamlaluno created an issue. See original summary.

cilefen’s picture

Issue tags: +Needs title update

I am tagging "Needs title update" because the title doesn't mention where in Drupal the documentation problem exists.

snehi’s picture

snehi’s picture

Title: Comment doesn't say what the code is doing » Wrong comment in User module in user.module file
Issue tags: -Needs title update
snehi’s picture

Status: Active » Needs review
FileSize
691 bytes

Please review attached patch.

nicrodgers’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me!

  • xjm committed 049d6b0 on 8.0.x
    Issue #2595605 by snehi, kiamlaluno, cilefen: Wrong comment in User...
xjm’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +rc eligible

I confirmed that there is nothing to do with $form_state anywhere in this alter hook implementation. :) At most it's related because it's preproccessing a form... I guess. But the previous docs were confusing, ungrammatical, and too long per our coding standards.

As a documentation-only fix, this change is considered "rc eligible" and can be committed any time during RC. Reference: https://www.drupal.org/core/d8-allowed-changes#rc Committed and pushed to 8.0.x. Thanks!

Status: Fixed » Closed (fixed)

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