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

Check module is enabled before compat init #537

Merged
merged 2 commits into from
Oct 31, 2019

Conversation

mjangda
Copy link
Member

@mjangda mjangda commented Oct 31, 2019

Otherwise we end up triggering the compat hooks which can lead to breakages because of unexpected contexts (e.g. custom status javascript being loaded without necessary data).

Fixes #522

To Test

  1. Disable block editor (by installing and activating "Classic Editor" plugin)
  2. Disable "Custom Statuses" module.
  3. Editing a post will throw the error.
  4. Apply patch.
  5. Error should be gone.

Also, verify that the Block Editor is not impacted in any way:

  1. Enable Custom Status and make sure editing works and custom status can be set and changed.
  2. Disable Custom Status and make sure editing still works.

WordPress 5.1
PHP 5.6 (matches WordPress)
Otherwise we end up triggering the compat hooks which can lead to
breakages because of unexpected contexts (e.g. custom status javascript
being loaded without necessary data).
Copy link
Contributor

@dchymko dchymko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally, LGTM

@dchymko dchymko merged commit 823d6e8 into master Oct 31, 2019
@GaryJones GaryJones deleted the fix/skip-compat-when-disabled branch December 9, 2019 15:02
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.

JS can't find variable
2 participants