When deleting a domain, the domain record is wiped from the db before hook_domainrecord() is fired.

Run the lookup first.

/**
 * FormsAPI for domain_delete_form()
 *
 * @ingroup domain 
 */
function domain_delete_form_submit($form_id, $form_values) {
  // Run the lookup before we delete the row!
  $domain = domain_lookup($form_values['domain_id']);
  db_query("DELETE FROM {domain} WHERE domain_id = %d", $form_values['domain_id']);
  // Let other modules act.
  module_invoke_all('domainupdate', 'delete', $domain, $form_values);
  drupal_set_message(t('Domain record deleted.'));
  drupal_goto('admin/build/domain/view');  
}

Comments

agentrickard’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD. In beta3 release.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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