From a1625c07ea3eeee41e67c26064b0ea23ce3723e4 Mon Sep 17 00:00:00 2001 From: Christoph Schlaepfer <1939311+Anuril@users.noreply.github.com> Date: Thu, 18 Jan 2024 09:58:58 +0100 Subject: [PATCH] Fixes an error when saving a plaintext textarea field when CKEditor is loaded and there are no textareas it initialized. (#2084) Fixes Issue with textarea fields, if ckeditor is loaded but there is not textarea with the class it has assigned. --- src/themes/admin_default/assets/js/fossbilling.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/themes/admin_default/assets/js/fossbilling.js b/src/themes/admin_default/assets/js/fossbilling.js index f20a44d35..5338d9071 100644 --- a/src/themes/admin_default/assets/js/fossbilling.js +++ b/src/themes/admin_default/assets/js/fossbilling.js @@ -150,7 +150,7 @@ globalThis.bb = { const formData = new FormData(formElement); // Get all CKEditor instances and replace the original textarea values with the updated content. - if (typeof editors !== "undefined" && Array.isArray(editors)) { + if (typeof editors !== "undefined" && Array.isArray(editors) && editors.length > 0) { let editorContentOnRequiredAttr = false; Object.keys(editors).forEach(function (name) { editorContentOnRequiredAttr = editors[name].required