diff --git a/core/lib/Drupal/Core/Entity/EntityForm.php b/core/lib/Drupal/Core/Entity/EntityForm.php index 506aeba..407b9d7 100644 --- a/core/lib/Drupal/Core/Entity/EntityForm.php +++ b/core/lib/Drupal/Core/Entity/EntityForm.php @@ -222,7 +222,7 @@ protected function actions(array $form, FormStateInterface $form_state) { 'class' => array('button', 'button--danger'), ), ); - $actions['delete'] += $route_info->toRenderArrayFragment(); + $actions['delete'] += $route_info->toRenderArray(); } return $actions; diff --git a/core/lib/Drupal/Core/Form/ConfirmFormHelper.php b/core/lib/Drupal/Core/Form/ConfirmFormHelper.php index 8598377..4a6cfec 100644 --- a/core/lib/Drupal/Core/Form/ConfirmFormHelper.php +++ b/core/lib/Drupal/Core/Form/ConfirmFormHelper.php @@ -43,7 +43,7 @@ public static function buildCancelLink(ConfirmFormInterface $form, Request $requ } // Check for a route-based cancel link. elseif ($url = $form->getCancelUrl()) { - return $url->toRenderArrayFragment($form->getCancelText()); + return $url->toRenderArray($form->getCancelText()); } $link['#type'] = 'link'; $link['#title'] = $form->getCancelText(); diff --git a/core/lib/Drupal/Core/Menu/Form/MenuLinkDefaultForm.php b/core/lib/Drupal/Core/Menu/Form/MenuLinkDefaultForm.php index df728c0..f6ee14b 100644 --- a/core/lib/Drupal/Core/Menu/Form/MenuLinkDefaultForm.php +++ b/core/lib/Drupal/Core/Menu/Form/MenuLinkDefaultForm.php @@ -113,7 +113,7 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta $link = array( '#type' => 'link', '#title' => $this->menuLink->getTitle(), - ) + $this->menuLink->getUrlObject()->toRenderArrayFragment(); + ) + $this->menuLink->getUrlObject()->toRenderArray(); $form['path'] = array( 'link' => $link, '#type' => 'item', diff --git a/core/lib/Drupal/Core/Url.php b/core/lib/Drupal/Core/Url.php index 8b0da1a..38d3c63 100644 --- a/core/lib/Drupal/Core/Url.php +++ b/core/lib/Drupal/Core/Url.php @@ -385,7 +385,7 @@ public function toArray() { * @return array * An associative array suitable for a render array. */ - public function toRenderArrayFragment($title = '') { + public function toRenderArray($title = '') { if ($this->isExternal()) { return array( '#type' => 'link', diff --git a/core/modules/comment/src/Form/CommentAdminOverview.php b/core/modules/comment/src/Form/CommentAdminOverview.php index 87f09c4..fcfcc80 100644 --- a/core/modules/comment/src/Form/CommentAdminOverview.php +++ b/core/modules/comment/src/Form/CommentAdminOverview.php @@ -197,11 +197,11 @@ public function buildForm(array $form, FormStateInterface $form_state, $type = ' $options[$comment->id()] = array( 'title' => array('data' => array('#title' => $comment->getSubject() ?: $comment->id())), 'subject' => array( - 'data' => $comment_permalink->toRenderArrayFragment($comment->getSubject()), + 'data' => $comment_permalink->toRenderArray($comment->getSubject()), ), 'author' => drupal_render($username), 'posted_in' => array( - 'data' => $commented_entity->urlInfo()->toRenderArrayFragment($commented_entity->label()) + array( + 'data' => $commented_entity->urlInfo()->toRenderArray($commented_entity->label()) + array( '#access' => $commented_entity->access('view'), ), ), diff --git a/core/modules/entity_reference/src/Plugin/Field/FieldFormatter/EntityReferenceLabelFormatter.php b/core/modules/entity_reference/src/Plugin/Field/FieldFormatter/EntityReferenceLabelFormatter.php index 8d8a0f2..46c4366 100644 --- a/core/modules/entity_reference/src/Plugin/Field/FieldFormatter/EntityReferenceLabelFormatter.php +++ b/core/modules/entity_reference/src/Plugin/Field/FieldFormatter/EntityReferenceLabelFormatter.php @@ -73,7 +73,7 @@ public function viewElements(FieldItemListInterface $items) { // If the link is to be displayed and the entity has a uri, display a // link. if ($this->getSetting('link') && $uri = $referenced_entity->urlInfo()) { - $elements[$delta] = $uri->toRenderArrayFragment($label); + $elements[$delta] = $uri->toRenderArray($label); if (!empty($item->_attributes)) { $elements[$delta]['#options'] += array('attributes' => array()); $elements[$delta]['#options']['attributes'] += $item->_attributes; diff --git a/core/modules/image/src/Form/ImageEffectFormBase.php b/core/modules/image/src/Form/ImageEffectFormBase.php index d575c51..212f5fe 100644 --- a/core/modules/image/src/Form/ImageEffectFormBase.php +++ b/core/modules/image/src/Form/ImageEffectFormBase.php @@ -93,7 +93,7 @@ public function buildForm(array $form, FormStateInterface $form_state, ImageStyl '#type' => 'submit', '#button_type' => 'primary', ); - $form['actions']['cancel'] = $this->imageStyle->urlInfo('edit-form')->toRenderArrayFragment($this->t('Cancel')); + $form['actions']['cancel'] = $this->imageStyle->urlInfo('edit-form')->toRenderArray($this->t('Cancel')); return $form; } diff --git a/core/modules/node/src/NodeListBuilder.php b/core/modules/node/src/NodeListBuilder.php index aec4692..763f0ff 100644 --- a/core/modules/node/src/NodeListBuilder.php +++ b/core/modules/node/src/NodeListBuilder.php @@ -101,7 +101,7 @@ public function buildRow(EntityInterface $entity) { $options = $uri->getOptions(); $options += ($langcode != LanguageInterface::LANGCODE_NOT_SPECIFIED && isset($languages[$langcode]) ? array('language' => $languages[$langcode]) : array()); $uri->setOptions($options); - $row['title']['data'] = $uri->toRenderArrayFragment($entity->label()) + array( + $row['title']['data'] = $uri->toRenderArray($entity->label()) + array( '#suffix' => ' ' . drupal_render($mark), ); $row['type'] = String::checkPlain(node_get_type_label($entity)); diff --git a/core/modules/system/src/Controller/DbUpdateController.php b/core/modules/system/src/Controller/DbUpdateController.php index b37ee75..97fa830 100644 --- a/core/modules/system/src/Controller/DbUpdateController.php +++ b/core/modules/system/src/Controller/DbUpdateController.php @@ -214,7 +214,7 @@ protected function info() { $url = new Url('system.db_update', array('op' => 'selection')); $build['link'] = array( '#attributes' => array('class' => array('button', 'button--primary')), - ) + $url->toRenderArrayFragment($this->t('Continue')); + ) + $url->toRenderArray($this->t('Continue')); return $build; } @@ -343,7 +343,7 @@ protected function selection() { $build['link'] = array( '#attributes' => array('class' => array('button', 'button--primary')), '#weight' => 5, - ) + $url->toRenderArrayFragment($this->t('Apply pending updates')); + ) + $url->toRenderArray($this->t('Apply pending updates')); } return $build; diff --git a/core/modules/taxonomy/src/Form/OverviewTerms.php b/core/modules/taxonomy/src/Form/OverviewTerms.php index 8abbbc2..46baace 100644 --- a/core/modules/taxonomy/src/Form/OverviewTerms.php +++ b/core/modules/taxonomy/src/Form/OverviewTerms.php @@ -221,7 +221,7 @@ public function buildForm(array $form, FormStateInterface $form_state, Vocabular '#size' => $term->depth, ); } - $form['terms'][$key]['term'] = $term->urlInfo()->toRenderArrayFragment($term->getName()) + array( + $form['terms'][$key]['term'] = $term->urlInfo()->toRenderArray($term->getName()) + array( '#prefix' => !empty($indentation) ? drupal_render($indentation) : '', ); if ($taxonomy_vocabulary->hierarchy != TAXONOMY_HIERARCHY_MULTIPLE && count($tree) > 1) { diff --git a/core/modules/taxonomy/src/Plugin/Field/FieldFormatter/LinkFormatter.php b/core/modules/taxonomy/src/Plugin/Field/FieldFormatter/LinkFormatter.php index 0499aff..c93b6fb 100644 --- a/core/modules/taxonomy/src/Plugin/Field/FieldFormatter/LinkFormatter.php +++ b/core/modules/taxonomy/src/Plugin/Field/FieldFormatter/LinkFormatter.php @@ -39,7 +39,7 @@ public function viewElements(FieldItemListInterface $items) { else { /** @var $term \Drupal\taxonomy\TermInterface */ $term = $item->entity; - $elements[$delta] = $term->urlInfo()->toRenderArrayFragment($term->getName()); + $elements[$delta] = $term->urlInfo()->toRenderArray($term->getName()); if (!empty($item->_attributes)) { $elements[$delta]['#options'] += array('attributes' => array());