From 1716f0f878f82b4e5afd185a817b165d2e11792b Mon Sep 17 00:00:00 2001 From: ppound Date: Fri, 22 Mar 2024 10:36:22 -0300 Subject: [PATCH] removed depracted function call --- magazineplus.theme | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/magazineplus.theme b/magazineplus.theme index 0fc580a..e2bc357 100644 --- a/magazineplus.theme +++ b/magazineplus.theme @@ -830,7 +830,7 @@ function magazineplus_preprocess_node(&$variables) { ->getCreatedTime(), $granularity = 1); $node_content = $variables['content']; - $node_content = render($node_content); + $node_content = \Drupal::service('renderer')->render($node_content); $words = str_word_count(strip_tags($node_content)); $minutes = floor($words / 275); $variables['minutes'] = $minutes; @@ -859,11 +859,11 @@ function magazineplus_preprocess_node__article(&$variables) { // Count the words of article in order to calculate the reading time $node_content = $variables['content']; - $node_content = render($node_content); + $node_content = \Drupal::service('renderer')->render($node_content); $words = str_word_count(strip_tags($node_content)); if (isset($variables['content']['comment'])) { $node_comments = $variables['content']['comment']; - $node_comments = render($node_comments); + $node_comments = \Drupal::service('renderer')->render($node_comments); $words = $words - str_word_count(strip_tags($node_comments)); } $variables['minutes'] = floor($words / 275);