elementor / elementor/elementor

Uncaught TypeError: Cannot read property 'toolbar1' of undefined

Open
#8,990 4 comments 0 reactions 0 assignees View on GitHub
mod/b*
Dominant language
PHP
Stars
7.1k
Forks
1.6k
Avg merge
1d 5h
Merged PRs (30d)
193

Description

I'm having the same issue from #404 ( closed in 2016 ) with `Uncaught TypeError: Cannot read property 'toolbar1' of undefined` triggered in `rearrangeButtons` when I try to edit a text field. Can't edit any text editor fields due to that.

Triggered by this line :
https://github.com/elementor/elementor/blob/master/assets/dev/js/editor/controls/wysiwyg.js#L137

This code block seems to be executing that function : https://github.com/elementor/elementor/blob/master/assets/dev/js/editor/controls/wysiwyg.js#L81-L85

It looks like `tinyMCEPreInit.mceInit.elementorwpeditor` is not defined - although it should be, right?
`tinyMCEPreInit.mceInit` is an object with empty keys, based on how many times I try to load the text editor:
![image](https://user-images.githubusercontent.com/762297/64337730-245f8180-d00a-11e9-8a81-1f1386ae1007.png)

Happy to debug more.

The bad part about this is that the text editor was loading properly just a few minutes/hours back, but when I attempted to restore an older 3-4 months old revision of the homepage through the WP interface ( Elementor revisions don't seem to go that far back ) this issue started appearing. I've disabled cache plugins, autooptimize, etc.

`elementor.config.wp_editor` has a value. Maybe the `onReady` event doesn't fire? I can see that this logic was recently changed here with the `if ( ! this.isDestroyed ) {` check : https://github.com/elementor/elementor/commit/170d95d3b9dfad312c54260b509ce41ae687305e by @kobizz - but I'm not sure this is related.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.