Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Motivation:
Drush is for people who get shit done fast and understand edge cases. The login link is optimized for edge cases that slows down 90% of users (seriously #24398: password reset is not working in some cases).
Solution:
Just login when you click.
Comment | File | Size | Author |
---|---|---|---|
#12 | 1829596_be_more_explicit_about_which_user_12.patch | 1.39 KB | greggles |
#7 | 1829596_be_more_explicit_about_which_user.patch | 1.06 KB | greggles |
#5 | user-login-browse-refactor.patch | 14.65 KB | Owen Barton |
#1 | 1829596_uli_needs_a_turbo.patch | 415 bytes | greggles |
Comments
Comment #1
gregglesTurbo boosted.
Comment #2
moshe weitzman CreditAttribution: moshe weitzman commentedCommitted to master. Not committed to 5.x since thats technically an API change (I could be convinced otherwise).
Comment #3
gregglesMakes sense. There are cases where drush is used as an api for other things (e.g. Aegir) where the 10% case might matter.
Comment #4
ergonlogicIn Aegir, we generate this login link by calling user_pass_reset_url() directly. But thanks for taking it into account.
Comment #5
Owen Barton CreditAttribution: Owen Barton commentedMore turbo - more flexibility in parameters, path redirection, browser detection/opening.
Comment #6
Owen Barton CreditAttribution: Owen Barton commentedCommitted
Comment #7
gregglesHoly cow that is a lot more turbo. Nice work.
The patch had
- drush_set_error("The user account with the name " . $name . " could not be loaded or is blocked!");+ drush_set_error("The user account could not be loaded or is blocked!");
?>
That name was added explicitly in #1645788: if user is blocked throw a warning instead of returning a login link so I'd love to know a bit more why it was removed. My sense is that with the refactoring it's a bit trickier to say which user. I've tried to add back some information that I think makes sense here, but didn't test it a ton.
Comment #8
gregglesComment #9
greg.1.anderson CreditAttribution: greg.1.anderson commentedInstead of
$condition = 'could not be found and';
, couldn't we just return drush_set_error here? The generated error message in this sense is a bit awkward, as the "or is blocked" clause is clearly not applicable if the user could not be found.Comment #10
Owen Barton CreditAttribution: Owen Barton commentedI was having trouble coming up with reasonable sounding wording and working on the basis that the default of uid 1 is pretty well known (and in any other case is provided by the parameter you supply), but perhaps that is not a valid assumption.
No objection to adding it though, although the wording "The user account could not be found and could not be loaded or is blocked!" strikes me as still fairly hard to grok.
Comment #11
Owen Barton CreditAttribution: Owen Barton commentedComment #12
gregglesSo, now that I've looked into _drush_user_get_users_from_options_and_arguments I see that it does it's own helpful drush_set_error in the case the account is not found so there's no need to handle that case in this function.
Seem good?
Comment #13
jonhattandt() is needed here.
Comment #14
greg.1.anderson CreditAttribution: greg.1.anderson commentedThis issue was marked
closed (won't fix)
because Drush has moved to Github.If this feature is still desired, you may copy it to our Github project. For best results, create a Pull Request that has been updated for the master branch. Post a link here to the PR, and please also change the status of this issue to
closed (duplicate)
.Please ask support questions on Drupal Answers.