Create an article
Toggle to html editor and add some code, e.g.
<div style="border: 1px solid red; padding: 10px;">
<div style="border: 1px solid blue; padding: 10px;">Some text here</div>
</div>
(Without toggling Editor) Click/tap 'Save'
New code should be saved and, if appropriate, displayed
Code disappears.
J4 Nightly from 13/10/2019
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.
Labels |
Added:
?
|
It is a completely different version of tinymce
None-the-less, it is a problem in J4x.
Can't confirm the issue.
@Scrabble96 Did you test with another browser? Is it a large text you edit? Very fast page reload? The Javascript should "save" the text back to the editor before closing the page and reloading..
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.
My alpha 12 installation was a bit old. Something has obviously happened in between. Now installed the nightly build from today 14/10.
The problem should come from a change in Joomla code somewhere.
I copied tiny's vendor directory from the new alpha 12 installation to an older alpha 12 instance. To save the text as described then still works.
Labels |
Added:
J4 Issue
|
Labels |
Added:
?
|
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.
Just a legacy, maybe from 1.0, in reason no one can explain.
I'm closing this since we have a PR #29351 thank @dgrammatiko
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-06-01 11:54:53 |
Closed_By | ⇒ | HLeithner | |
Labels |
Added:
?
Removed: ? |
Labels |
Removed:
?
|
It is a completely different version of tinymce