The "Go to ..." and "Login to ..." links we provide currently hardcode the site name/url. While this is fine in most cases, there are some where it can result in problems, or become almost useless. For example, when we are redirecting to an alias, it'd be nice to use the alias there instead. This would be especially handy when using subdirs, as the site name sub-domain may not be pointing at the server at all.

This should be relatively simple to implement. Our site alias/context already contains 'redirection' => 'example.com/site1', and Drush already supports: drush @site1.example.com -l example.com/site1 uli. Where we build the link, in _hosting_site_goto_link(), it should be pretty straight-forward to use the redirect alias, if one is set.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ergonlogic created an issue. See original summary.

ergonlogic’s picture

See attached patches.

ergonlogic’s picture

I created branches in both Hosting and Provision (dev/fix-login-links) where I applied these patches.

I'll work on fixes for #3025905: Login URLs not working on Drupal 8 subdirectory sites in this same branch.

ergonlogic’s picture

Status: Needs review » Needs work

The fixes so far work nicely, but only apply when we run the "Reset password" task. As such, if we define an alias and redirect to it during install, the login link provided post-install is still broken. We seem to replicate this functionality in a couple places, so we'll need to track it down, and have it do the same as we do for password resets.

llamech’s picture

the login link provided post-install is still broken

The attached patch fixes this problem.

llamech’s picture

the login link provided post-install is still broken

The attached patch ( provision-use_redirect_target_for_install_login_link-3034235-5.patch) fixes this problem.

ergonlogic’s picture

Status: Needs work » Needs review

I've committed the patch posted by @llamech in #6 to the dev/fix-login-links branch of Provision.

Setting to "Needs review", since I believe this piece is complete. #3025905: Login URLs not working on Drupal 8 subdirectory sites still needs work though.

llamech’s picture

Fixes for this, along with other subdirectory site fixes, are all in #3036890: Simplify subdir site installation. For simplicity, let's validate there.

ergonlogic’s picture

Status: Needs review » Fixed

We're merging fixes from #3036890: Simplify subdir site installation, which resolves this issue too.

Status: Fixed » Closed (fixed)

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

Jon Pugh’s picture

Status: Closed (fixed) » Needs work

Reopening, the branch has an extra commit that wasn't merged.

Jon Pugh’s picture

Status: Needs work » Fixed
colan’s picture

Hopefully that commit wasn't left out intentionally, and won't break anything. Can you easily pull up which one it was?

Jon Pugh’s picture

https://git.drupalcode.org/project/hosting/commit/c87b348d3f34d9c791ad4b...

No it was just the addition of the helper function for "canonical url string".

colan’s picture

I'd give that comment a thumbs up if #2987034: Allow reacting to comments were done. Moving to the GitLab issue tracker would fix this too. ;)

Jon Pugh’s picture

Project: Hostmaster (Aegir) » Provision
Assigned: Unassigned » ergonlogic
Status: Fixed » Needs review

Found another branch in provision with further changes: https://git.drupalcode.org/project/provision/compare/7.x-3.x...3034235-f...

There's a lot of extra stuff in there, though. Not sure what it's for.

Jon Pugh’s picture

@ergonlogic can you clarify that the addition of Provision/Config/Drupal/Services.php is desired here?

This code is not yet in 7.x-3.x, should it be?

Thanks

colan’s picture

  • llamech committed 7211aca on 7.x-4.x
    Fixes #3034235: Use alias redirection target in login links.
    
  • llamech committed ed32764 on 7.x-4.x authored by ergonlogic
    Issue #3034235 by llamech, ergonlogic: Use alias redirection target in...