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

Changed the way that Gutenberg detection happens. Gutenberg can be fa… #210

Merged
merged 1 commit into from
Jul 31, 2019

Conversation

talonon
Copy link
Contributor

@talonon talonon commented Jul 31, 2019

We ran into an issue with javascript errors when submitting jobs from the page editor. I discovered that the issue was caused by having these 3 plugins:

Smartling Connector
Classic Editor
Yoast SEO (or any other plugin that enqueues the React library)

Gutenberg uses React. Smartling Connector detects that React is loaded to determine wether or not the editor is Gutenberg vs Classic using a simple if (window.React) { }. Because we’re using the Classic Editor plugin, Gutenbert is disabled there should be no React.

The problem arises with the Yoast SEO plugin. It also uses React. This makes Smartling Connector think that the editor is Gutenberg, so it tries to show alerts using the Gutenberg core/notices, which doesn’t exist because we’re actually using the Classic Editor.

We changed the way that Gutenberg is detected from a simple React check to using a class on the body. This method is defined here WordPress/gutenberg#12200 (comment)

…lsely detected as enabled when the Classic Editor Plugin is installed and Yoast SEO is installed. Yoast SEO enqueues the React library, which causes false positive on Gutenberg enabled. This false positive causes javascript errors when adding a page to a translation job or adding a page to an existing job.

Using body class detection method defined WordPress/gutenberg#12200 (comment)
@dimitrystd dimitrystd requested a review from paveldhq July 31, 2019 18:38
@paveldhq paveldhq merged commit 50ee201 into Smartling:master Jul 31, 2019
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 this pull request may close these issues.

2 participants