Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug - CKEDITOR is not defined when CKEDITOR is disabled and window too small when loading Text Template. #609

Open
VeldoraTheDragon opened this issue Oct 23, 2024 · 0 comments

Comments

@VeldoraTheDragon
Copy link

Environment

  • Server OS: FreeBSD 13.3
  • Browser: Brave 1.70.119
  • Znuny version: 6.5.6

Expected behavior

When loading a Text Template in the Communication -> Note while the RichTextEditor is disabled and the screen is extremly small, the template should still load, without even bothering, if CKEDITOR is disabled or not.

Actual behavior

When loading a Text Template in the Communication -> Note while the RichTextEditor is disabled and the screen is extremely small, the TextArea doesn't update and the loading-circle is circling forever, saying in the browser-console, that CKEDITOR is not defined.

CommonJS_1fb76dcb19b7ee7c1c67869ef1461b2b.js:1648 Uncaught ReferenceError: CKEDITOR is not defined
    at UpdateTextarea (CommonJS_1fb76dcb19b7ee7c1c67869ef1461b2b.js:1648:377)
    at String.<anonymous> (CommonJS_1fb76dcb19b7ee7c1c67869ef1461b2b.js:1662:29)
    at Function.each (CommonJS_1fb76dcb19b7ee7c1c67869ef1461b2b.js:1:3179)
    at UpdateFormElements (CommonJS_1fb76dcb19b7ee7c1c67869ef1461b2b.js:1657:3)
    at Object.success (CommonJS_1fb76dcb19b7ee7c1c67869ef1461b2b.js:1674:6)
    at c (CommonJS_1fb76dcb19b7ee7c1c67869ef1461b2b.js:1:25266)
    at Object.fireWith [as resolveWith] (CommonJS_1fb76dcb19b7ee7c1c67869ef1461b2b.js:1:26015)
    at l (CommonJS_1fb76dcb19b7ee7c1c67869ef1461b2b.js:1:77721)
    at XMLHttpRequest.<anonymous> (CommonJS_1fb76dcb19b7ee7c1c67869ef1461b2b.js:1:80204)

I've pinned down the relevant code that's causing the issue.

if (Core.App.Responsive.IsSmallerOrEqual(Core.App.Responsive.GetScreenSize(), 'ScreenL') && (!localStorage.getItem("DesktopMode") || parseInt(localStorage.getItem("DesktopMode"), 10) <= 0)) {
CKEditorObj = CKEDITOR;
}

Is there a way to somehow implement a check, if CKEDITOR is defined, instead of assuming that it isn't disabled?
I guess this would already bypass the issue.

How to reproduce

Steps to reproduce the behavior:

  1. Disable the RichTextEditor
  2. Open a Queue with asigned Text Templates
  3. Open a Ticket in this Queue
  4. Open Communication -> Note
  5. Resize the pop-up window to very small
  6. Load the Text-Template
  7. See error in browser-console.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant