From 91c1bba220c52939c41d7df27ad6123bea339857 Mon Sep 17 00:00:00 2001 From: Marty Date: Thu, 9 Dec 2021 16:34:54 -0500 Subject: [PATCH] MDL-73332 mustache: Fix shortentext helper In the docs, it claims you can provide length to the shortentext template helper as a context variable. In reality, that is not the case. --- lib/classes/output/mustache_shorten_text_helper.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/classes/output/mustache_shorten_text_helper.php b/lib/classes/output/mustache_shorten_text_helper.php index 16bb1a7d84b..8a470647903 100644 --- a/lib/classes/output/mustache_shorten_text_helper.php +++ b/lib/classes/output/mustache_shorten_text_helper.php @@ -55,8 +55,9 @@ class mustache_shorten_text_helper { $length = trim($length); $text = trim($text); - // Allow mustache tags in the text. + // Allow mustache tags in the length and text. $text = $helper->render($text); + $length = $helper->render($length); return shorten_text($text, $length); }