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.
Comments
Comment #2
ergonlogicSee attached patches.
Comment #3
ergonlogicI 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.
Comment #4
ergonlogicThe 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.
Comment #5
llamechThe attached patch fixes this problem.
Comment #6
llamechThe attached patch ( provision-use_redirect_target_for_install_login_link-3034235-5.patch) fixes this problem.
Comment #7
ergonlogicI'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.
Comment #8
llamechFixes for this, along with other subdirectory site fixes, are all in #3036890: Simplify subdir site installation. For simplicity, let's validate there.
Comment #9
ergonlogicWe're merging fixes from #3036890: Simplify subdir site installation, which resolves this issue too.
Comment #11
Jon PughReopening, the branch has an extra commit that wasn't merged.
Comment #12
Jon PughComment #13
colanHopefully that commit wasn't left out intentionally, and won't break anything. Can you easily pull up which one it was?
Comment #14
Jon Pughhttps://git.drupalcode.org/project/hosting/commit/c87b348d3f34d9c791ad4b...
No it was just the addition of the helper function for "canonical url string".
Comment #15
colanI'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. ;)
Comment #16
Jon PughFound 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.
Comment #17
Jon Pugh@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
Comment #18
colan