diff --git a/core/modules/shortcut/lib/Drupal/shortcut/Form/SwitchShortcutSet.php b/core/modules/shortcut/lib/Drupal/shortcut/Form/SwitchShortcutSet.php index 9864990..d301477 100644 --- a/core/modules/shortcut/lib/Drupal/shortcut/Form/SwitchShortcutSet.php +++ b/core/modules/shortcut/lib/Drupal/shortcut/Form/SwitchShortcutSet.php @@ -37,7 +37,7 @@ class SwitchShortcutSet extends FormBase { * Constructs a SwitchShortcutSet object. * * @param \Drupal\shortcut\ShortcutSetStorageControllerInterface $shortcut_set_storage_controller - * The shortcut storage controller. + * The shortcut set storage controller. */ public function __construct(ShortcutSetStorageControllerInterface $shortcut_set_storage_controller) { $this->storageController = $shortcut_set_storage_controller; @@ -145,11 +145,11 @@ public function validateForm(array &$form, array &$form_state) { if ($form_state['values']['set'] == 'new') { // Check to prevent creating a shortcut set with an empty title. if (trim($form_state['values']['label']) == '') { - form_set_error('new', $form_state, $this->t('The new set label is required.')); + $this->setFormError('new', $form_state, $this->t('The new set label is required.')); } // Check to prevent a duplicate title. if (shortcut_set_title_exists($form_state['values']['label'])) { - form_set_error('label', $form_state, $this->t('The shortcut set %name already exists. Choose another name.', array('%name' => $form_state['values']['label']))); + $this->setFormError('label', $form_state, $this->t('The shortcut set %name already exists. Choose another name.', array('%name' => $form_state['values']['label']))); } } } @@ -167,7 +167,7 @@ public function submitForm(array &$form, array &$form_state) { $set = $this->storageController->create(array( 'id' => $form_state['values']['id'], 'label' => $form_state['values']['label'], - 'links' => $default_set->links, + 'links' => $default_set->getShortcuts(), )); $set->save(); $replacements = array( @@ -184,7 +184,12 @@ public function submitForm(array &$form, array &$form_state) { else { drupal_set_message($this->t('%user is now using a new shortcut set called %set_name. You can edit it from this page.', $replacements)); } - $form_state['redirect'] = 'admin/config/user-interface/shortcut/manage/' . $set->id(); + $form_state['redirect_route'] = array( + 'route_name' => 'shortcut.set_customize', + 'route_parameters' => array( + 'shortcut_set' => $set->id(), + ), + ); } else { // Switch to a different shortcut set. diff --git a/core/modules/shortcut/lib/Drupal/shortcut/ShortcutSetStorageController.php b/core/modules/shortcut/lib/Drupal/shortcut/ShortcutSetStorageController.php index 7b72ee9..1c04d91 100644 --- a/core/modules/shortcut/lib/Drupal/shortcut/ShortcutSetStorageController.php +++ b/core/modules/shortcut/lib/Drupal/shortcut/ShortcutSetStorageController.php @@ -29,7 +29,7 @@ class ShortcutSetStorageController extends ConfigStorageController implements Sh protected $moduleHandler; /** - * Constructs a ConfigStorageController object. + * Constructs a ShortcutSetStorageController object. * * @param string $entity_type * The entity type for which the instance is created.