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.

CommentFileSizeAuthor
hosting_site.get_with_alias.patch786 byteshadsie

Comments

adrian’s picture

Status: Needs review » Needs work

patches need to be against head.

Anonymous’s picture

This 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).

Anonymous’s picture

Somewhat 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.

Anonymous’s picture

Status: Needs work » Fixed

But 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!

Status: Fixed » Closed (fixed)

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

  • Commit d862882 on 6.x-2.x, 7.x-3.x, dev-ssl-ip-allocation-refactor, dev-sni, dev-helmo-3.x by mig5:
    #860582 by hadsie, mig5: Get site by alias as well as url
    

  • Commit d862882 on 6.x-2.x, 7.x-3.x, dev-ssl-ip-allocation-refactor, dev-sni, dev-helmo-3.x by mig5:
    #860582 by hadsie, mig5: Get site by alias as well as url