hyunsupul / aesop-core

Open-sourced suite of components that empower interactive storytelling in WordPress.
http://aesopstoryengine.com
GNU General Public License v2.0
244 stars 56 forks source link

Added undefined check on tinyMCE. #151

Closed peiche closed 10 years ago

peiche commented 10 years ago

Since upgrading to 1.2, I consistently get "tinyMCE is not defined" errors. This check resolves these errors.

bearded-avenger commented 10 years ago

Hey Paul! 1.2 has been out for quite a while now, and so far you are the only person who has reported this. As you can imagine I'm a bit apprehensive about adding a fix for something that we can't replicate as being broken.

@etcook any thoughts on this?

etcook commented 10 years ago

@peiche Thanks for this.

I don't mind this PR - but I would like to address the source of the error if we can rather than just quieting it.

When is it happening for you? Just on normal page loads?

peiche commented 10 years ago

This is happening on every post edit screen. I just (like, literally 2 minutes ago) figured out how to replicate this problem, even in an Aesop demo instance. (This thing here: http://tryaesop.com/)

Go to your profile page. Check "Disable visual editor" and save.

error

Then create a new post or edit an existing one. Clicking "Add Component" brings up the window just fine, but if you try to insert a component or close the modal, it will result in the JavaScript error: "Uncaught reference: tinyMCE is not defined."

Unchecking "Disable visual editor" removes the related JavaScript error.

bearded-avenger commented 10 years ago

Thanks Paul. I didn't realize that to produce the error the visual editor has to be disabled through settings. That makes sense. Can you PR to the dev branch please?

peiche commented 10 years ago

Done. I didn't change the commit message, though.