diff --git a/edit_stack_form.php b/edit_stack_form.php
index 3eb9d55e2bf874730a01680a3b4358c44117ec88..819f4b2e29c589821af954409b522e9d545936c6 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');
         }