The module for quickly reinstalling a site seems like a good candidate for hosting_task_extras.

3.x version is in https://www.drupal.org/project/hosting_dev

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jon Pugh created an issue. See original summary.

Jon Pugh’s picture

Issue summary: View changes
Jon Pugh’s picture

FileSize
0 bytes

Patch attached. I don't have commit access to push a branch.

Jon Pugh’s picture

FileSize
3.8 KB
Jon Pugh’s picture

FileSize
25.92 KB
Jon Pugh’s picture

FileSize
3.8 KB
helmo’s picture

Status: Needs review » Needs work
FileSize
4.04 KB

I added a warning to the confirmation form...

When testing I got one warning:

Error validating client email ``. Please check your user account email. To allow the site installation to proceed, the email `this.email@is.invalid` has been used instead. Please use the `login` link to change the site admin email to a proper valid address.

In provision/platform/install.provision.inc we pass in the client_email ...

$result = provision_backend_invoke(d()->name, "provision-install-backend", array(), array('client_email' => drush_get_option('client_email')));

Which we don't in this code:

provision_backend_invoke($alias_name, "provision-install");

I don't think we get this option in the current context, but we should be able to...

helmo’s picture

@Jon Pugh now you do have maintainer access

Jon Pugh’s picture

Yeah, for some reason client_email is not a property on the site context...

Wouldn't it make sense to do that so we don't have to pass it all the time?

helmo’s picture

I guess that the original thought was that it would be only needed once... during install.

But the value originates in the client... so in the site context it would be a copy, which needs to be kept in sync :(

  • Jon Pugh committed 0eead0e on 2838431-reinstall
    Issue #2838431 by Jon Pugh, helmo: Add Hosting Site Reinstall to...
Jon Pugh’s picture

Helmo: I pushed the patch into a new branch: 2838431-reinstall

Here's the code that sets the client_email:

From hosting/site/hosting_site.drush.inc

$client = node_load($task->ref->client);
  $user = user_load($task->uid);
  if ($task->task_type != 'import' && $task->task_type != 'delete' && $task->task_type != 'verify') {
    $task->options['client_email'] = $user->mail;
  }
  $task->context_options['client_name'] = $client->uname;

I think we can go ahead and assume that the Site UID is the intended client. If someone changes the author of the site, they are doing se advanced stuff as we block those fields, right?

I'll push a patch to set these in the reinstall task.

Jon Pugh’s picture

I'm not sure anymore we need a new task type.

The "install" task can be forced to run again instead. We could alter the install task confirm form to provide a good user experience, and plenty of warning that the site will be destroyed.