From 1c7c208ed8134d5d5dba32eff1e612440d595793 Mon Sep 17 00:00:00 2001 From: TamaroWalter Date: Thu, 7 Sep 2023 12:25:27 +0200 Subject: [PATCH] function in locallib changed for behat testing environment --- locallib.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/locallib.php b/locallib.php index c70935b1a2..98b4451ba9 100644 --- a/locallib.php +++ b/locallib.php @@ -654,8 +654,12 @@ function moodleoverflow_get_post_full($postid) { if ($CFG->branch >= 311) { $allnames = \core_user\fields::for_name()->get_sql('u', false, '', '', false)->selects; - } else { + } else if ($CFG->branch > 309) { $allnames = implode(', ', fields::get_name_fields()); + } else { + // TODO: remove this else branch when support for version 3.9 ends and replace the else if branch with 'else' only. + // Note that get_all_user_name_fields is a deprecated function and should not be used in newer versions. + $allnames = get_all_user_name_fields(true, 'u'); } $sql = "SELECT p.*, d.moodleoverflow, $allnames, u.email, u.picture, u.imagealt FROM {moodleoverflow_posts} p