Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Classic Text block fails to preview if ACF is installed #3512

Closed
nylen opened this issue Nov 16, 2017 · 4 comments
Closed

Classic Text block fails to preview if ACF is installed #3512

nylen opened this issue Nov 16, 2017 · 4 comments

Comments

@nylen
Copy link
Member

nylen commented Nov 16, 2017

Using a fresh install of WP 4.9 and Gutenberg 1.7.0 with the Advanced Custom Fields plugin activated (version 4.4.12), upon inserting a Classic Text block, the block cannot be used or edited:

2017-11-16t14 55 54 0800

The following errors (including more attempts to download non-existent TinyMCE plugins) appear in the console:

2017-11-16t14 59 43 0800

Deactivating the ACF plugin resolves this issue as well as the failed requests for TinyMCE plugins.

@BoardJames
Copy link

@ephox-mogran and I spent some time trying to figure out what is going wrong.

The error message is being caused by the theme failing to load. The theme and plugins are failing to load because TinyMCE is trying to get it from wp-content/plugins/gutenberg/vendor when it should be loading them from wp-includes/js/tinymce. This seems to be happening because the global tinyMCE.baseURL is being overwritten when gutenberg loads.

So I think the following is happening:

  1. Wordpress TinyMCE is loaded with the base url wp-includes/js/tinymce
  2. Gutenberg TinyMCE is loaded with the base url wp-content/plugins/gutenberg/vendor which overwrites the global tinyMCE.baseURL
  3. Wordpress TinyMCE tries to load plugins (possibly ACF requests a TinyMCE instance?) and uses the global tinyMCE.baseURL which looks for them in wp-content/plugins/gutenberg/vendor and fails
  4. The vendored plugin files load so the plugins are made available
  5. Gutenberg editors load and since the vendored plugins register themselves it doesn't matter that the baseUrl is wrong because it never has to look for them.

@youknowriad
Copy link
Contributor

Is it time to rely on the same version for classic and gutenberg editor @iseulde ?

@nylen
Copy link
Member Author

nylen commented Nov 21, 2017

possibly ACF requests a TinyMCE instance?

Probably so, this type of issue is one reason why we initially chose to render metaboxes within iframes.

Not saying that was the right solution, just providing context.

@youknowriad
Copy link
Contributor

Fixed by #6848

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants