-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[4.0] TinyMCE does not save if 'save' selected when html editor toggled #26579
Comments
It is a completely different version of tinymce |
None-the-less, it is a problem in J4x. |
Can't confirm the issue. |
By the way - I removed this toggle button with a layout override for my own component to only use tiny's built in "code" button. |
I can confirm this behaviour |
I can now confirm it. |
The problem should come from a change in Joomla code somewhere. |
So I spend quite some time on this one today. The problem is that version 5 of tinyMCE break compatibility with version 4 in this part. There are 2 solutions here:
None of them is ideal but not my decision here |
Destroying and recreate seams the more consistent way also for other editors what's the drawback if we do this? |
@HLeithner destroying and recreating the instance should be avoided, it should be the last resort not the first option. IIRC both me and @Fedik have avoided this pattern so far in J4. The obvious reason, especially with scripts that have very well documented API on their lifecycle, is that devs might do something on after initialisation of the script. If the instance is destroyed on recreation their code will be ignored and (depending if their using event or not) might not re execute. Let me raise a question on their tracker, it might be an easier (undocumented) way to do this. |
I don't say it'S a good method but it's the better then removing the button and since that's the only 2 options you gave me I had to choose ;-) But just for clarification to trigger this problem:
right? |
Yes, the steps are correct. If you follow my issue upstream you’ll find out that the problem is only on the submit event. I guess they can flip some part of their code so if there is an attach functionality on that event that will happen before they push their existing data. I’m quite confident that this will be solved on their side |
I would just trash that button, this function should belong to the editor instance itself. |
@Fedik people are familiar with it also the fix turns out to be super easy (if you knew deeply their API, of course I didn’t but I asked). check my pr... |
I'm closing this since we have a PR #29351 thank @dgrammatiko |
Steps to reproduce the issue
Create an article
Toggle to html editor and add some code, e.g.
(Without toggling Editor) Click/tap 'Save'
Expected result
New code should be saved and, if appropriate, displayed
Actual result
Code disappears.
System information (as much as possible)
J4 Nightly from 13/10/2019
Additional comments
If, however, you toggle the Editor back to WYSIWYG before saving, the code is saved.
I have tested this in J3 and it works as expected.
The text was updated successfully, but these errors were encountered: