When I add a site alias, the site is being verified. Once the verification passes and a new site alias is added, the site sets itself as disabled and needs to be enabled manually.

Comments

steveparks’s picture

One of the dev team (mig5) has been able to replicate this issue, and is working on a fix. We'll update this ticket when that's ready to be tested. Thanks for the bug report.

Anonymous’s picture

Once the verification passes and a new site alias is added, the site sets itself as disabled and needs to be enabled manually.

Actually, in my tests, it appears the site is disabled *upon* submission of the site node form after adding an alias, at the same time that the new Verify task is created and enters the queue.

i.e it doesn't become disabled on successful completion of the Verify task. This is just a note for myself in my tests, while I keep working on it.

Anonymous’s picture

So I figured this out last night in a dream. oh dear!

It's occuring right after the form is submitted because it's caused by hook_update().

hosting_site_update() updates the entry in hosting_site and updates the status field with the value of $node->site_status. On the form when editing, I guess site_status value is being reset to 0, or not found, or something.

To prove the case I hardcoded the update query to insert status 1 and it didn't disable the site.

Still working on a fix, trying to work out why it's not passing the existing status value on an update. Getting closer though.

Anonymous’s picture

So it's a catch22: $node->site_status is null on the update hook, modifying the update query to use $node->status inserts 1, and then a Disable task succeeds but never disables the site! Somehow though it sets $task->ref->site_status = HOSTING_SITE_DISABLED, it won't override the current status in the hosting_site table if that field was inserted from $node->status in hook_update. But it will happily set it if $node->site_status is passed in hook_update, even though that value is NULL! Come up against yet another brick wall now.

Anonymous’s picture

Status: Active » Fixed

Fixed in HEAD.

We weren't actually passing attributes such as site_status, verified and last_cron in the form, and so hosting_form_update was sending null values to the database.

Thanks to all who assisted on IRC. Such a trivial thing but I just didn't see it.

Status: Fixed » Closed (fixed)

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