diff --git a/core/lib/Drupal/Core/Entity/EntityFormController.php b/core/lib/Drupal/Core/Entity/EntityFormController.php index 69b7c80..b177a2a 100644 --- a/core/lib/Drupal/Core/Entity/EntityFormController.php +++ b/core/lib/Drupal/Core/Entity/EntityFormController.php @@ -223,7 +223,9 @@ protected function actions(array $form, array &$form_state) { if (!$this->entity->isNew() && $this->entity->hasLinkTemplate('delete-form')) { $route_info = $this->entity->urlInfo('delete-form'); if ($this->getRequest()->query->has('destination')) { - $route_info['options']['query']['destination'] = $this->getRequest()->query->get('destination'); + $query = $route_info->getOption('query'); + $query['destination'] = $this->getRequest()->query->get('destination'); + $route_info->setOption('query', $query); } $actions['delete'] = array( '#type' => 'link', @@ -231,10 +233,8 @@ protected function actions(array $form, array &$form_state) { '#attributes' => array( 'class' => array('button', 'button--danger'), ), - '#options' => $route_info->getOptions(), - '#route_name' => $route_info->getRouteName(), - '#route_parameters' => $route_info->getRouteParameters(), ); + $actions['delete'] += $route_info->toRenderArray(); } return $actions; diff --git a/core/modules/forum/lib/Drupal/forum/Form/ForumFormController.php b/core/modules/forum/lib/Drupal/forum/Form/ForumFormController.php index 4935b60..9ac2e88 100644 --- a/core/modules/forum/lib/Drupal/forum/Form/ForumFormController.php +++ b/core/modules/forum/lib/Drupal/forum/Form/ForumFormController.php @@ -106,12 +106,9 @@ protected function actions(array $form, array &$form_state) { if (!$this->entity->isNew() && $this->entity->hasLinkTemplate('forum-delete-form')) { $route_info = $this->entity->urlInfo('forum-delete-form'); - $route_info += array( - 'route_parameters' => array(), - ); - $actions['delete']['#options'] = $route_info['options']; - $actions['delete']['#route_name'] = $route_info['route_name']; - $actions['delete']['#route_parameters'] = $route_info['route_parameters']; + $actions['delete']['#options'] = $route_info->getOptions(); + $actions['delete']['#route_name'] = $route_info->getRouteName(); + $actions['delete']['#route_parameters'] = $route_info->getRouteParameters(); } else { unset($actions['delete']);