MIGX
MIGX copied to clipboard
Corrupted working with TinyMCE RTE
When using TinyMCE RTE as a default editor, if you uncheck checkbox "Use HTML-editor" in the resource's properties, TinyMCE RTE isn't working in TV MIGX. If default editor is TinyMCE (not RTE), it works no matter this checkbox is checked or not.
@komatera do you think, this is a MIGX or a TinyMCE RTE issue. Any idea, how this could be solved?
Oh, I didnt' really expect that it can be RTE problem... I'm not a coder, but I can check older RTE editor without checked checkbox.
Hey guys. I can confirm this behavior. TinyMCE RTE (Jako's version) doesn't work as a MIGX field. Maybe it's some new JS that came up? I don't see any errors in the console, however Redactor and CKEditor work fine. Would be great if someone would fix this or at least figure out what the cause is.
According to @azeller, the resource has to use the RTE to have the RTE enabled inside of MIGX. That has to be solved inside of TinyMCE RTE. This is a long existing bug in TinyMCE RTE.
@Jako I'm not entirely sure if it is sufficient to have the RTE inside the resource instantiated. I know this is the case with Google Maps TV, so the relevant JS-dependency gets loaded. For the RTE it's a certain event that has to get triggered. 1.4.0-pl works fine, it's just the new one that doesn't seem to work.
I agree with @Jako, it is working inside migx, if enabled for the whole resource
Thanks @komatera - I can confirm that the behavior is exactly the same. If TinyMCE is embedded in the resource, for example as a content block, it's working inside of MIGX as well. After all, this seems like it could be a MIGX dependency issue? So custom TVs like MapsTV and TinyMceRTE can have dependencies that need to be loaded if they are part of the variable?
It can be partly a MIGX dependency issue. MIGX should invoke the OnRichTextEditorRegister event, if it does not do that currently.
But if the event is invoked inside of MIGX, the script is only loaded, if the resource has an enabled RTE option, because of the current code. That has to be changed backwards compatible.
OnRichTextEditorRegister doesn't really help us here, right? If you for example use ContentBlocks, that event might not get called after all because the editor is called inline. MIGX should do the same and initialize the editor on demand. I think this might actually be an issue with the text-based input of the MIGX input types.
So basically what would be needed is a list of input types that have certain dependencies, such as for example an init call to a certain method or including a certain library.
OnRichTextEditorRegister registers the javascripts of TinyMCE RTE and the script transforms the content field automatically, if they are registered, thats the issue. Registering has to work without transforming. And the transform has to be triggered on javascript base by the value of the content field.
That will be some work in the TinyMCE RTE package. And I currently have not much time to do that.