You are here

function domain_repair_form in Domain Access 7.3

Repairs and updates instances of domain_id 0 after the update to 7.x.3.

1 string reference to 'domain_repair_form'
domain_menu in ./domain.module
Implements hook_menu().

File

./domain.admin.inc, line 1220
Administration functions for the domain module.

Code

function domain_repair_form($form, &$form_state) {
  $list = domain_update_module_check();
  if (empty($list)) {
    $form['list'] = array(
      '#markup' => '<p>' . t('No updates are required. <a href="!url">Return to domain administration</a>.', array(
        '!url' => url('admin/structure/domain'),
      )) . '</p>',
    );
  }
  else {
    $form['intro'] = array(
      '#markup' => '<p>' . t('The following modules have data that references domain_id 0 and will be updated:') . '</p>',
    );
    $modules = array();
    foreach ($list as $item) {
      $modules[] = check_plain($item['name']);
    }
    $form['list'] = array(
      '#markup' => theme('item_list', array(
        'items' => $modules,
      )),
    );
    $form['outro'] = array(
      '#markup' => '<p>' . t('All records marked with domain_id 0 will be assigned to the default domain.') . '</p>',
    );
    $form['tables'] = array(
      '#type' => 'value',
      '#value' => domain_update_tables($list),
    );
    $form['submit'] = array(
      '#type' => 'submit',
      '#value' => t('Update database tables'),
    );
  }
  return $form;
}