function services_client_error_admin_repair in Services Client 7
Same name and namespace in other branches
- 7.2 services_client_error/services_client_error.admin.inc \services_client_error_admin_repair()
Resend data to connection that produced error
1 string reference to 'services_client_error_admin_repair'
- services_client_error_menu in services_client_error/
services_client_error.module - Implements hook_menu().
File
- services_client_error/
services_client_error.admin.inc, line 182 - Administration callbacks for error handling.
Code
function services_client_error_admin_repair($form, &$form_state, $error) {
$form['error'] = array(
'#type' => 'value',
'#value' => $error,
);
$entity = reset(entity_load($error['entity_type'], array(
$error['entity_id'],
)));
$rows = array();
$rows[] = array(
t('Created'),
format_date($error['created'], 'short'),
);
$rows[] = array(
t('Entity type'),
check_plain($error['entity_type']),
);
// If entity exists on local system, show link to entity.
if (!empty($entity)) {
$uri = entity_uri($error['entity_type'], $entity);
$rows[] = array(
t('Entity ID'),
l($error['entity_id'], $uri['path'], $uri['options']),
);
}
else {
$rows[] = array(
t('Entity ID'),
check_plain($error['entity_id']),
);
}
$rows[] = array(
t('Hook'),
check_plain($error['hook']),
);
$rows[] = array(
t('Connection'),
check_plain($error['connection']),
);
$rows[] = array(
t('Task'),
check_plain($error['task']),
);
$rows[] = array(
t('Retries'),
check_plain($error['retries']),
);
$rows[] = array(
t('Result'),
services_client_error_status_title($error['status']),
);
$form['info'] = array(
'#theme' => 'table',
'#header' => array(
array(
'data' => t('Info'),
'colspan' => 2,
),
),
'#rows' => $rows,
);
$history = services_client_error_admin_log_list($error);
if (!empty($history['table']['#rows'])) {
$form['history'] = $history['table'];
}
if (empty($history) && !empty($_REQUEST['destination'])) {
$form['back'] = array(
'#markup' => '<p>' . l(t('Back'), $_REQUEST['destination']) . '</p>',
);
}
$form['actions'] = array();
if (empty($error['completed'])) {
$form['actions']['sync'] = array(
'#type' => 'submit',
'#value' => t('Synchronize'),
'#submit' => array(
'services_client_error_admin_repair_synchronize',
),
);
$form['actions']['mark'] = array(
'#type' => 'submit',
'#value' => t('Mark as completed (synchronized).'),
'#submit' => array(
'services_client_error_admin_repair_mark',
),
);
}
$form['actions']['delete'] = array(
'#type' => 'submit',
'#value' => t('Delete error'),
'#submit' => array(
'services_client_error_admin_repair_delete',
),
);
return $form;
}