Opened 10 years ago
Closed 9 years ago
#31901 closed defect (bug) (fixed)
JS error while post editing
Reported by: | m_i_n | Owned by: | azaozz |
---|---|---|---|
Milestone: | 4.2 | Priority: | normal |
Severity: | normal | Version: | 4.2 |
Component: | TinyMCE | Keywords: | has-patch commit |
Focuses: | javascript | Cc: |
Description
Hi,
since version WP 4.2 beta 2 (probably), there is an error in JS console while editing post: http://i.imgur.com/IE96L5K.png (TypeError: c is undefined).
It makes editing post/page basically impossible.
It doesn't occur always, though. Mostly after full page refresh (ctrl+f5), but not always. Often enough to make it impossible to work on posts.
My test environment is:
- WP 4.2-beta4-32021
- standard theme (doesn't matter which one)
- dummy content imported
- all plugins off
Attachments (1)
Change History (12)
#1
@
10 years ago
- Component changed from General to TinyMCE
- Focuses ui administration removed
- Keywords reporter-feedback added
#2
@
10 years ago
It's the same error in other browser (Chrome): http://i.imgur.com/BTu8DNq.png
I've noticed the problem disappears when you activate SCRIPT_DEBUG mode.
So my guess is, it might be caused by JS minification.
#4
follow-up:
↓ 5
@
9 years ago
I've made new test on WP 4.2 RC 1. Clean install, all default. Same problem.
Works fine only with SCRIPT_DEBUG mode on.
#5
in reply to:
↑ 4
@
9 years ago
- Milestone changed from Awaiting Review to 4.2
Finally was able to reproduce this. Seems caused by "too fast" loading of the editor when reloading the page :)
Happens in the wpemoji
plugin. The reason seems to be that window.twemoji
is not defined yet by the time the TinyMCE wpemoji
plugin is initialized, as the editor JS is in the browser's memory cache at that point. Calling window.twemoji
directly in the plugin's methods seems to fix it.
#6
@
9 years ago
In 31901.patch: use window.twemoji
directly in the TinyMCE "wpemoji" plugin. Gives a chance to the browser to load twemoji.
Could you please test with SCRIPT_DEBUG true and report the error again? Does it happen in other browers too?