Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
user system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
28 Jun 2015 at 19:29 UTC
Updated:
29 Sep 2015 at 10:54 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #1
zakir.gori commentedComment #2
willzyx commenteduser status, used as #default_value in the radio element, is checked using \Drupal\user\UserInterface::isActive() which return a boolean.
Comment in \Drupal\Core\Render\Element\Radios::processRadios() say:
this is a little weird..if user account is blocked (status == FALSE) the default value is not considered
Comment #3
masipila commentedReviewed and succesfully tested.
@willzyx, regarding your wondering. I believe that the documentation is correct.
Thanks for a quick patch!
Cheers,
Markus
Comment #4
willzyx commentedI think we need some tests..
Comment #5
willzyx commentedComment #7
manauwarsheikh commentedWhat: Verified for Blocked user's status.
Result: "Blocked" status is appearing for the blocked user)screenshot attached).
Comment #8
alexpottNice test coverage.
I think rather than doing the cast to int we should just use $account->get('status') instead of $account->isActive().
That way if the status system is extended by contrib to have other values they need to change less.
Comment #9
willzyx commentedAddressing #8 but I don't think it is a real improvement. I think that if we want to allow contrib modules to extend status system in a comfortable way we should add getter and setter methods for status in user entity and create constants for active and blocked statuses. Currently we use (at least in AccountForm) a fragile (positional) logic for the management of this attribute
Comment #12
willzyx commentedfailures seem unrelated to this issue, retesting
Comment #14
googletorp commentedThe patch looks good. It has
• A failing test only patch
• A combined patch that fixes the test
• Code is clean and all is good.
Comment #15
googletorp commentedAdd beta evaluation.
Comment #16
alexpottCommitted efeb597 and pushed to 8.0.x. Thanks!
Thanks for adding the beta evaluation.