Magento2: Show/hide Editor not working sometimes

Created on 2 Jun 2016  Â·  54Comments  Â·  Source: magento/magento2

Hai,

I have faced this problem when i edit content in CMS -> Pages.Show/hide editor doesn't work sometimes.Eventhough i have removed all content and save it doesn't work.I can't see any js error in console. So please let me know how to solve this.

Cms Format is not valid Ready for Work bug report

Most helpful comment

  • Go to store->configuration→general→content management→enable wysiwyg edit uncheck checkbox and save configurations.
  • Remove pub/static ,var/generation ,var/cache,var/view_preprocessed
  • deploy static content

All 54 comments

Show/hide editor worked after i sign out admin panel.

Hi @devishreebalasubramanian

What is your browser name/version and OS?

No update was received from the author.
Closed as non-reproducible.

Hai,

Sorry for too late reply. I have used Firefox 43.0 in ubuntu 14.0.

I have the same error, it seems really 50/50. When it doesnt show the show/hide button doesnt work (and no js errors), but when the editor shows the button does work. First I thought it was a browser issue but switching didnt seem to help.

It happens not only with CMS, but with adding/editing products as well.

Using Chrome and Safari latest version, PHP 7.0.7, Magento in dev mode and cache off.

We are having the same problem;
tried on: Chrome, Firefox & Safari
php: 7.0.7
developer mode
cache on & off

We think it has something to do with the order in which the js are executed. Because if you refresh you page it's indeed 50/50 chance it will work.

*Edit: it's the editor_plugin.js that's not loaded sometimes

Has anyone come up with a solution for this? I am having exactly the same problem.

Looks like it still issue. Reopened.

@koenner01, @luxwan13 which version of Magento do you use?

@koenner01 is on holiday, so I'll answer in his name: we use Magento CE 2.1.0

@hostep, thank you for the fast answer.

Created internal ticket MAGETWO-57911 to investigate this issue.

@shiftedreality
I am using version 2.1.0

In case this helps someone. This problem mostly happens when you have enabled JS Bundling.
When you disable JS Bundling, most of the time (not always) the Show/Hide button does work correctly.
And I've also seen it work one single time with JS Bundling enabled.

So I'm pretty sure this issue is because a dependency is incorrectly defined (using requirejs?) and sometimes the correct js files are loaded before other js files and sometimes not which in this case causes this issue (not properly debugged, because it's a hell to debug js when bundling is enabled).

As a temporary workaround, I was trying to disable JS Bundling only in the adminhtml and keep it enabled in the frontend, but unfortunately this doesn't work at all. I've opened a new issue for this new bug...

And I'm also linking some related/duplicate issues here, since they weren't linked already:

As an investigation shows, the problem is inside 3d party library tinymce, which we shouldn't modify. TinyMCE uses own Event manager and when we call tinymce.init() tinymce sometimes doesn't trigger ‘init’ event itself, so initialise doesn’t execute.

@hostep @luxwan13 @shiftedreality @koenner01
there is an issue in tinyMCE itself that we can't fix as it's 3d party library. We are working on updating WYCIWYG plugin in Magento.

I can confirm this bug in Magento 2.1.1.

As @hostep says, I had JS Bundling enabled. Once I disabled it, editor started working.

Thanks @hostep

@tkacheva: can you elaborate a little bit on your comment?
Are you saying you are trying to make the TinyMCE plugin working in the current codebase, or are you going to drop it entirely and replace it with something else?
If the last one is the case, then it will probably take months until we see an improvement here, right?

Because currently this issue is preventing us from putting shops into production since non-technical shopowners have a really hard time entering html syntax.

It would be very much appreciated if this issue could get some higher priority.
Thanks!

Fix is delivered to the develop branch. @shiftedreality can you close the issue?
Issues for backporting to 2.0.x and 2.1.x branches are MAGETWO-59691 and MAGETWO-59688 correspondingly.

I can confirm that this issue persists in Edge browser. The button does appear, but does not work. The text box displays all HTML tags by default.

I have this issue with Magento 2.1.3 and Microsoft Edge browser as well: sometimes the TinyMCE is "missing". The WYSIWYG Editor button won't do anything either. Refresh does not help. I have advised my customer to use Firefox instead.
missingeditor

We still have this issue in two stores (2.1.3 and 2.1.2) with Internet Explorer, Chrome, Firefox and Edge on Windows 10 and Windows 7.

I still have this issue in my project with Magento 2.1.5, Firefox 52.0 and Ubuntu 16.04.

I had the same issue, Magento 2.1.5, Ubuntu 16.04, FireFox
I have enabled JS bundling, the problem solved. Take this steps:
Store -> Configuration -> Advanced -> Developer > JS Bundling Yes/No

Having the same problem in 2.1.5.

Thanks rastin1 for you response but in my case this is not a solution because enable or disable JS Bundling doesn't do to WYSIWYG to work properly

Have you tried refreshing the page to see if that WYSIWYG editor appears? It works for me.

We are also having this issue in 2.1.5 with JS&CSS Bundling enabled.

change your browser

Still present with Magento 2.1.5 JS&CSS bundling enabled. It does not look professional to my clients.. Must be fixed for all browsers and with bundling enabled or disabled.

When will this issue be fixed? Happens on all browsers.

We are running into those issues 2 on 2.1.5 systems :)

Same here on 2.1.5

  • Go to store->configuration→general→content management→enable wysiwyg edit uncheck checkbox and save configurations.
  • Remove pub/static ,var/generation ,var/cache,var/view_preprocessed
  • deploy static content

@mailtomayaz that's work

As a quick workaround I also discovered that after the page has loaded one simple f5 on that page does the trick to load the WYSIWYC editor.

This is definitely still an issue that majorly impacts usability, when can we expect a fix here?

Still not working on 2.1.5 :(

I am also having this problem on 2.1.4.

Confirming that @mailtomayaz's comment seems to work.

Unfortunately the fix suggested by magento-team doesnt' work...

hi @br0k3n ,
that works for me: https://github.com/magento/magento2/commit/eebdb8c34027b661f1125a8d1532cef1798bd17a
don't know it you meant this fix.

please make sure you clear the cache (clear at least this js file cache in CDN too)

cheers

still doesn't work for us on 2.1.6

The workaround posted by @mailtomayaz worked for us on 2.1.7.

We still require a definitive fix for this!

Internal ticket to track issue progress: MAGETWO-68903

We get the same issue after upgrading to 2.1.9!
Bundling and Minify JS are both enabled.

This intermittent loading of the WYSIWYG editor appears in development mode on 2.1.8 - sometimes it loads, sometimes it doesn't. In production mode, the WYSIWYG editor does not work at all, throwing JavaScript errors, attached.

console-errors

@OnePhilT your browser tries to load minified tiny_mce. It shouldn't be minified. Your have to use extension which overrides dev/js/minify_exclude setting. In my case It was MSP_ReCaptcha.

Thanks, @maqlec. I realised about the JavaScript minification issue when I subsequently followed other threads. I think this issue wasn't resolved in version 2.2.2, although I managed a workaround to avoid minifying TinyMCE JavaScript.

As I saw in another thread, it has fixed in 2.3-develop branch

@magento-engcom-team & @shiftedreality, after reviewing this thread it appears no action has occurred for 2.2.x versions. I'm on 2.2.4 the latest iteration and it's still an issue. These are the types of issues that give Magento a bad reputation. Is there a backported patch for 2.2.4?

Since I'll likely not get a direct answer, @OnePhilT what did you do to solve the issue? I see solutions from modifying JS to wait for DOM loaded, removing it from minification, to enabling WYSIWYG by default, deleting all generated files and starting over. I mean if it can be fixed without any code changes that would be great, but any suggestions are welcome!

@duffner: the original reported bug was fixed in https://github.com/magento/magento2/commit/3524943ac6544ee969480536ef6f0cd1a29b0b56 for Magento 2.2.x and in https://github.com/magento/magento2/pull/9499/commits/6b07d07c65ef972457b856081a63e222e7cd69d3 for Magento 2.1.x

If you can still reproduce this bug on 2.2.4, it might be best if you create a new issue with exact steps of how to reproduce on a clean installation preferably. Thanks!

I have same issue on magento 2.2.4 as @duffner said. after upgrading from 2.2.3 (where editor works) on 2 shops to magento 2.2.4 editor is broken if js is bundeled

@matin73: please try updating the Klarna modules to the latest version using composer, or just disable them if you don't use those, it should fix the problem in 2.2.4 (btw: it was caused by a different bug in 2.2.4, not by the one which was discussed in this thread).

Is this issue resolved? I have a 2.1.5 installation with is problem.

@kanenas: it was resolved, but not sure if that happened before 2.1.5 was released. However, I would strongly advise you to upgrade to a newer Magento version, version 2.1.5 is really old and no longer supported.

Was this page helpful?
0 / 5 - 0 ratings