Commit 45c60ea0 authored by webchick's avatar webchick

Issue #1939024 follow-up by tim.plunkett: Small clean-ups to code.

parent eebd0637
......@@ -121,7 +121,7 @@ function action_admin_configure_submit($form, &$form_state) {
action_save($function, $form_state['values']['action_type'], $params, $form_state['values']['action_label'], $aid);
drupal_set_message(t('The action has been successfully saved.'));
$form_state['redirect'] = 'admin/config/system/actions/manage';
$form_state['redirect'] = 'admin/config/system/actions';
}
/**
......@@ -137,7 +137,7 @@ function action_admin_delete_form($form, &$form_state, $action) {
);
return confirm_form($form,
t('Are you sure you want to delete the action %action?', array('%action' => $action->label)),
'admin/config/system/actions/manage',
'admin/config/system/actions',
t('This cannot be undone.'),
t('Delete'),
t('Cancel')
......@@ -153,7 +153,7 @@ function action_admin_delete_form_submit($form, &$form_state) {
action_delete($aid);
watchdog('user', 'Deleted action %aid (%action)', array('%aid' => $aid, '%action' => $action->label));
drupal_set_message(t('Action %action was deleted', array('%action' => $action->label)));
$form_state['redirect'] = 'admin/config/system/actions/manage';
$form_state['redirect'] = 'admin/config/system/actions';
}
/**
......
......@@ -66,7 +66,6 @@ function action_menu() {
'title' => 'Manage actions',
'description' => 'Manage the actions defined for your site.',
'type' => MENU_DEFAULT_LOCAL_TASK,
'route_name' => 'action_admin_manage',
);
$items['admin/config/system/actions/configure'] = array(
'title' => 'Configure an advanced action',
......@@ -84,12 +83,6 @@ function action_menu() {
'access arguments' => array('administer actions'),
'file' => 'action.admin.inc',
);
$items['admin/config/system/actions/orphan'] = array(
'title' => 'Remove orphans',
'description' => 'Remove actions that are in the database but not supported by any enabled module.',
'route_name' => 'action_admin_orphans_remove',
'type' => MENU_CALLBACK,
);
return $items;
}
......
......@@ -5,13 +5,6 @@ action_admin:
requirements:
_permission: 'administer actions'
action_admin_manage:
pattern: '/admin/config/system/actions/manage'
defaults:
_content: '\Drupal\action\Controller\ActionController::adminManage'
requirements:
_permission: 'administer actions'
action_admin_orphans_remove:
pattern: '/admin/config/system/actions/orphan'
defaults:
......
......@@ -37,10 +37,10 @@ function testActionConfiguration() {
$user = $this->drupalCreateUser(array('administer actions'));
$this->drupalLogin($user);
// Make a POST request to admin/config/system/actions/manage.
// Make a POST request to admin/config/system/actions.
$edit = array();
$edit['action'] = drupal_hash_base64('action_goto_action');
$this->drupalPost('admin/config/system/actions/manage', $edit, t('Create'));
$this->drupalPost('admin/config/system/actions', $edit, t('Create'));
// Make a POST request to the individual action configuration page.
$edit = array();
......@@ -75,7 +75,7 @@ function testActionConfiguration() {
// Make sure that the action was actually deleted.
$this->assertRaw(t('Action %action was deleted', array('%action' => $new_action_label)), 'Make sure that we get a delete confirmation message.');
$this->drupalGet('admin/config/system/actions/manage');
$this->drupalGet('admin/config/system/actions');
$this->assertNoText($new_action_label, "Make sure the action label does not appear on the overview page after we've deleted the action.");
$exists = db_query('SELECT aid FROM {actions} WHERE callback = :callback', array(':callback' => 'drupal_goto_action'))->fetchField();
$this->assertFalse($exists, 'Make sure the action is gone from the database after being deleted.');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment