diff core/modules/comment/comment.tokens.inc @ 18:af1871eacc83

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:33:08 +0100
parents 129ea1e6d783
children
line wrap: on
line diff
--- a/core/modules/comment/comment.tokens.inc	Thu Feb 28 13:21:36 2019 +0000
+++ b/core/modules/comment/comment.tokens.inc	Thu May 09 15:33:08 2019 +0100
@@ -180,12 +180,12 @@
         // Comment related URLs.
         case 'url':
           $url_options['fragment'] = 'comment-' . $comment->id();
-          $replacements[$original] = $comment->url('canonical', $url_options);
+          $replacements[$original] = $comment->toUrl('canonical', $url_options)->toString();
           break;
 
         case 'edit-url':
           $url_options['fragment'] = NULL;
-          $replacements[$original] = $comment->url('edit-form', $url_options);
+          $replacements[$original] = $comment->toUrl('edit-form', $url_options)->toString();
           break;
 
         case 'author':
@@ -209,13 +209,13 @@
         case 'created':
           $date_format = DateFormat::load('medium');
           $bubbleable_metadata->addCacheableDependency($date_format);
-          $replacements[$original] = format_date($comment->getCreatedTime(), 'medium', '', NULL, $langcode);
+          $replacements[$original] = \Drupal::service('date.formatter')->format($comment->getCreatedTime(), 'medium', '', NULL, $langcode);
           break;
 
         case 'changed':
           $date_format = DateFormat::load('medium');
           $bubbleable_metadata->addCacheableDependency($date_format);
-          $replacements[$original] = format_date($comment->getChangedTime(), 'medium', '', NULL, $langcode);
+          $replacements[$original] = \Drupal::service('date.formatter')->format($comment->getChangedTime(), 'medium', '', NULL, $langcode);
           break;
 
         case 'entity':