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

AtD / Gutenberg: request is made to AtD when module is deactivated #10548

Closed
jeherve opened this issue Nov 6, 2018 · 1 comment
Closed

AtD / Gutenberg: request is made to AtD when module is deactivated #10548

jeherve opened this issue Nov 6, 2018 · 1 comment
Assignees
Labels
[Feature] AtD [Focus] Blocks Issues related to the block editor, aka Gutenberg, and its extensions developed in Jetpack [Pri] BLOCKER [Type] Bug When a feature is broken and / or not performing as intended
Milestone

Comments

@jeherve
Copy link
Member

jeherve commented Nov 6, 2018

Steps to reproduce the issue

  1. Start with a site using Gutenberg or WP 5.0 Beta 3
  2. Under Jetpack > Settings, deactivate the Spell checker option.
  3. Go to Posts > Add New

You'll notice a JavaScript error:

GET https://mysite.com/wp-admin/admin-ajax.php?action=atd_settings&ver=20150715 503

Setting add_filter( 'jetpack_gutenberg', '__return_false' ); solves the problem, as the AtD scripts are then no longer loaded.

@jeherve jeherve added [Type] Bug When a feature is broken and / or not performing as intended [Feature] AtD [Focus] Blocks Issues related to the block editor, aka Gutenberg, and its extensions developed in Jetpack labels Nov 6, 2018
@jeherve jeherve added this to the 6.8 milestone Nov 6, 2018
@jeherve
Copy link
Member Author

jeherve commented Nov 7, 2018

It appears to be limited to WP 5.0 Beta 3; it does not happen with the Gutenberg plugin.

@lezama lezama self-assigned this Nov 7, 2018
@jeherve jeherve modified the milestones: 6.8, 6.7.1 Nov 8, 2018
jeherve pushed a commit that referenced this issue Nov 9, 2018
…activated (#10566)

Fixes #10548
Fixes #10495
Fixes #10558

#### Changes proposed in this Pull Request:
* Instead of using `get_initial_state()` to shorthand how we get module activation data for block visibility this PR manually builds the needed data.
* `get_initial_state()` calls `get_modules` from `Jetpack_Core_API_Module_List_Endpoint` which doesn't respect module activation and [includes modules files](https://github.com/Automattic/jetpack/blame/496bebd5b1890666afe4fc79f52fd94353d88539/_inc/lib/class.core-rest-api-endpoints.php#L2813) which enqueues JS files ¯\_(ツ)_/¯ 

#### Testing instructions:
* Follow the steps in #10548
* Ideally you wont see any JS errors

#### Proposed changelog entry for your changes:
* Fixes an issue where deactivating ATD causes the post editor to throw JS errors
jeherve pushed a commit that referenced this issue Nov 9, 2018
…activated (#10566)

Fixes #10548
Fixes #10495
Fixes #10558

#### Changes proposed in this Pull Request:
* Instead of using `get_initial_state()` to shorthand how we get module activation data for block visibility this PR manually builds the needed data.
* `get_initial_state()` calls `get_modules` from `Jetpack_Core_API_Module_List_Endpoint` which doesn't respect module activation and [includes modules files](https://github.com/Automattic/jetpack/blame/496bebd5b1890666afe4fc79f52fd94353d88539/_inc/lib/class.core-rest-api-endpoints.php#L2813) which enqueues JS files ¯\_(ツ)_/¯ 

#### Testing instructions:
* Follow the steps in #10548
* Ideally you wont see any JS errors

#### Proposed changelog entry for your changes:
* Fixes an issue where deactivating ATD causes the post editor to throw JS errors
@jeherve jeherve modified the milestones: 6.7.1, 6.8 Nov 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] AtD [Focus] Blocks Issues related to the block editor, aka Gutenberg, and its extensions developed in Jetpack [Pri] BLOCKER [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
Development

No branches or pull requests

2 participants