diff --git a/core/lib/Drupal/Core/Revision/RevisionControllerTrait.php b/core/lib/Drupal/Core/Revision/RevisionControllerTrait.php index 75a9aae..859782f 100644 --- a/core/lib/Drupal/Core/Revision/RevisionControllerTrait.php +++ b/core/lib/Drupal/Core/Revision/RevisionControllerTrait.php @@ -48,7 +48,7 @@ public function revisionPageTitle($revision_id) { if ($entity instanceof TimestampedRevisionInterface) { return $this->t('Revision of %title from %date', array( '%title' => $entity->label(), - '%date' => format_date($entity->getRevisionCreationTime()) + '%date' => \Drupal::service('date.formatter')->format($entity->getRevisionCreationTime()), )); } else { @@ -198,7 +198,7 @@ public function revisionOverview(ContentEntityInterface $entity) { } else { $row[] = $this->getRevisionDescription($revision, FALSE); - $links = $this->getLinks($entity, $vid); + $links = $this->getOperationLinks($entity, $vid); $row[] = [ 'data' => [ @@ -232,7 +232,7 @@ public function revisionOverview(ContentEntityInterface $entity) { * @return array * The operation links. */ - protected function getLinks(EntityInterface $entity, $revision_id) { + protected function getOperationLinks(EntityInterface $entity, $revision_id) { $links = []; $revert_permission = $this->hasRevertRevisionPermission($entity); $delete_permission = $this->hasDeleteRevisionPermission($entity); diff --git a/core/modules/node/src/Controller/NodeController.php b/core/modules/node/src/Controller/NodeController.php index 087ca32..b42479a 100644 --- a/core/modules/node/src/Controller/NodeController.php +++ b/core/modules/node/src/Controller/NodeController.php @@ -212,14 +212,23 @@ protected function hasDeleteRevisionPermission(EntityInterface $entity) { * {@inheritdoc} */ protected function buildRevertRevisionLink(EntityInterface $entity, $revision_id) { - $langcode = $this->languageManager()->getCurrentLanguage(LanguageInterface::TYPE_CONTENT)->getId(); + $langcode = $this->languageManager() + ->getCurrentLanguage(LanguageInterface::TYPE_CONTENT) + ->getId(); $languages = $entity->getTranslationLanguages(); $has_translations = (count($languages) > 1); return [ 'title' => $this->t('Revert'), - 'url' => $has_translations ? - Url::fromRoute('node.revision_revert_translation_confirm', ['node' => $entity->id(), 'node_revision' => $revision_id, 'langcode' => $langcode]) : - Url::fromRoute('node.revision_revert_confirm', ['node' => $entity->id(), 'node_revision' => $revision_id]), + 'url' => $has_translations ? + Url::fromRoute('node.revision_revert_translation_confirm', [ + 'node' => $entity->id(), + 'node_revision' => $revision_id, + 'langcode' => $langcode + ]) : + Url::fromRoute('node.revision_revert_confirm', [ + 'node' => $entity->id(), + 'node_revision' => $revision_id + ]), ]; }