diff --git a/core/lib/Drupal/Core/Entity/EntityManager.php b/core/lib/Drupal/Core/Entity/EntityManager.php index 8514833..6be0e2d 100644 --- a/core/lib/Drupal/Core/Entity/EntityManager.php +++ b/core/lib/Drupal/Core/Entity/EntityManager.php @@ -33,7 +33,7 @@ class EntityManager extends PluginManagerBase { /** - * The injection container that should be injected into all controllers. + * The injection container that should be passed into the controller factory. * * @var \Symfony\Component\DependencyInjection\ContainerInterface */ diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php index 50ee981..06c89ff 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php @@ -68,6 +68,10 @@ public static function createInstance(ContainerInterface $container, $entity_typ * Overrides Drupal\Core\Entity\EntityFormController::form(). */ public function form(array $form, array &$form_state) { + $query = $this->request->query; + // @todo: Revisit this when http://drupal.org/node/1668866 is in. + $form_state['redirect'] = $query->get('destination'); + $view = $this->entity; $display_id = $this->displayID; // Do not allow the form to be cached, because $form_state['view'] can become @@ -268,11 +272,7 @@ public function submit(array $form, array &$form_state) { } $view->set('display', $displays); - // Direct the user to the right url, if the path of the display has changed. - $query = $this->request->query; - // @todo: Revisit this when http://drupal.org/node/1668866 is in. - $destination = $query->get('destination'); - if (!empty($destination)) { + if (!empty($form_state['destination'])) { // Find out the first display which has a changed path and redirect to this url. $old_view = views_get_view($view->id()); $old_view->initDisplay();