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

MODx.loadRTE is undefined / not initialising editor correctly #29

Open
Mark-H opened this issue Aug 14, 2023 · 0 comments
Open

MODx.loadRTE is undefined / not initialising editor correctly #29

Mark-H opened this issue Aug 14, 2023 · 0 comments

Comments

@Mark-H
Copy link
Contributor

Mark-H commented Aug 14, 2023

This comes from an issue using Redactor. There was a small change in Redactor 3.1.5 where it only defines MODx.loadRTE if Redactor is specifically requested/initialised. The purpose of that change was to allow the use of a different editor (like TinyMCE) globally, while using Redactor's ability to be enabled on other specific elements (like specific ContentBlocks fields).

This surfaced one/two issues with the way Formalicious initialises editors.

  1. Formalicious does not check if MODX.loadRTE is defined before calling it for the email content field. This means the Formalicious component breaks when the editor isn't loaded for whatever reason

Error trace:

Scherm­afbeelding 2023-08-14 om 18 53 26

Suggestion:

            if (MODx.config.which_editor === 'TinyMCE RTE') {
                config.skin = MODx.config['tinymcerte.skin'];

                new TinyMCERTE.Tiny({
                    allowDrop : true
                }, config);
-            } else {
-                MODx.loadRTE(id, config);
-            }
+            } else if (MODx.loadRTE) {
+                MODx.loadRTE(id, config);
+            }
  1. Formalicious doesn't seem to run the OnRichTextEditorInit event to initialise editors in a universal way. While Redactor loads itself globally, it only sets MODx.loadRTE if OnRichTextEditorInit is called.

(For more details on this, see https://docs.modmore.com/en/Redactor/v3.x/Usage/Third_Party_Extras.html)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant