From 3f0ed4f4870461f4b89197bb374ce6d1ed9ed7bd Mon Sep 17 00:00:00 2001
From: Chris Sangwin <C.J.Sangwin@ed.ac.uk>
Date: Fri, 6 Dec 2024 10:41:49 +0000
Subject: [PATCH] Fix to issue #1328: suppress warning when default text editor
 is the plain textarea.

---
 edit_stack_form.php | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/edit_stack_form.php b/edit_stack_form.php
index 3eb9d55e2..819f4b2e2 100644
--- a/edit_stack_form.php
+++ b/edit_stack_form.php
@@ -156,7 +156,6 @@ class qtype_stack_edit_form extends question_edit_form {
 
     protected function definition_inner(/* MoodleQuickForm */ $mform) {
         global $OUTPUT;
-        global $USER;
 
         // Load the configuration.
         $this->stackconfig = stack_utils::get_config();
@@ -195,7 +194,7 @@ class qtype_stack_edit_form extends question_edit_form {
 
         // TO-DO: add in warnings here.  See b764b39675 for deleted materials.
         $warnings = '';
-        if (get_user_preferences('htmleditor', '', $USER) !== 'textarea') {
+        if (get_class(editors_get_preferred_editor()) !== 'textarea_texteditor') {
             $warnings = '<i class="icon fa fa-exclamation-circle text-danger fa-fw"></i>' . stack_string('usetextarea');
         }
 
-- 
GitLab