Version: 6.x-0.4-alpha8
I'm not sure of the larger implications of something like this. But I think it would make sense for hosting_get_site_by_url() in hosting_site.module to return the site even if the $url is an alias. The attached patch updates the SQL query to also search against site aliases.
| Comment | File | Size | Author |
|---|---|---|---|
| hosting_site.get_with_alias.patch | 786 bytes | hadsie |
Comments
Comment #1
adrian commentedpatches need to be against head.
Comment #2
Anonymous (not verified) commentedThis also probably needs a check to see if the hosting_site_alias table even exists (we can't assume the Site Aliases feature has been enabled).
Comment #3
Anonymous (not verified) commentedSomewhat related to this:
Currently the only use of
hosting_get_site_by_url()was in Platform's post verify hook. It used it to detect sites that didn't already exist in the db, and if not, import them.I changed this to use our existing API function
hosting_allowed_domain(). This prevents a site from being imported that is actually already an alias of an existing site.Comment #4
Anonymous (not verified) commentedBut for the sake of the API I also committed a version of hadsie's patch that conditionally checks by alias if the Alias feature is enabled.
Thanks hadsie!