elliotcondon/acf — pull request #85 by kadamwhite (2013-06-22 20:09:06+00:00)
Title: Prevent JS exception on tinyMCE.settings when editor is not present

This script expects that tinyMCE will have been instantiated by the main WordPress WYSIWYG editor. If you are editing a custom post type which does not support the `editor` capability, `tinyMCE.settings` is undefined and reading properties off of it interrupts script execution.

ACF's JS is then left in a half-initialized state—for example, 'acf/setup_fields' will never be broadcast, so on page load fields will not be correctly hidden based on conditional logic.

The best fix would be to check for this and manually instantiate tinyMCE from the plugin script if WordPress hasn't already done it itself, but either way the safeguard of `return`ing when the editor is unavailable prevents some nasty side-effects.