Updated to Drupal 8.6.4, which is PHP 7.3 friendly. Also updated HTMLaw library....
[yaffs-website] / web / core / modules / forum / forum.module
index c2de3c9e0bde94974060ac64b698150595479cde..2833779d96d63e9a118c0d9681e81c3e69bd1074 100644 (file)
@@ -455,17 +455,20 @@ function template_preprocess_forums(&$variables) {
           $variables['topics'][$id]->title_link = \Drupal::l($topic->getTitle(), $topic->urlInfo());
           $variables['topics'][$id]->message = '';
         }
-        $forum_submitted = ['#theme' => 'forum_submitted', '#topic' => (object) [
-          'uid' => $topic->getOwnerId(),
-          'name' => $topic->getOwner()->getDisplayName(),
-          'created' => $topic->getCreatedTime(),
-        ]];
-        $variables['topics'][$id]->submitted = drupal_render($forum_submitted);
+        $forum_submitted = [
+          '#theme' => 'forum_submitted',
+          '#topic' => (object) [
+            'uid' => $topic->getOwnerId(),
+            'name' => $topic->getOwner()->getDisplayName(),
+            'created' => $topic->getCreatedTime(),
+          ],
+        ];
+        $variables['topics'][$id]->submitted = \Drupal::service('renderer')->render($forum_submitted);
         $forum_submitted = [
           '#theme' => 'forum_submitted',
           '#topic' => isset($topic->last_reply) ? $topic->last_reply : NULL,
         ];
-        $variables['topics'][$id]->last_reply = drupal_render($forum_submitted);
+        $variables['topics'][$id]->last_reply = \Drupal::service('renderer')->render($forum_submitted);
 
         $variables['topics'][$id]->new_text = '';
         $variables['topics'][$id]->new_url = '';
@@ -519,6 +522,7 @@ function template_preprocess_forums(&$variables) {
         $table['#rows'][] = $row;
       }
 
+      $variables['topics_original'] = $variables['topics'];
       $variables['topics'] = $table;
       $variables['topics_pager'] = [
         '#type' => 'pager',
@@ -569,7 +573,7 @@ function template_preprocess_forum_list(&$variables) {
       $variables['forums'][$id]->old_topics = $forum->num_topics - $variables['forums'][$id]->new_topics;
     }
     $forum_submitted = ['#theme' => 'forum_submitted', '#topic' => $forum->last_post];
-    $variables['forums'][$id]->last_reply = drupal_render($forum_submitted);
+    $variables['forums'][$id]->last_reply = \Drupal::service('renderer')->render($forum_submitted);
   }
 
   $variables['pager'] = [
@@ -636,7 +640,7 @@ function template_preprocess_forum_submitted(&$variables) {
   $variables['author'] = '';
   if (isset($variables['topic']->uid)) {
     $username = ['#theme' => 'username', '#account' => User::load($variables['topic']->uid)];
-    $variables['author'] = drupal_render($username);
+    $variables['author'] = \Drupal::service('renderer')->render($username);
   }
   $variables['time'] = isset($variables['topic']->created) ? \Drupal::service('date.formatter')->formatTimeDiffSince($variables['topic']->created) : '';
 }