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

File sync: JSON API: Add new wrapper function on WordPress.com to match Jetpack-only funct… #12133

Conversation

dereksmart
Copy link
Member

@dereksmart dereksmart commented Apr 23, 2019

Add new wrapper function on WordPress.com to match Jetpack-only funtion

Summary:
When syncing Jetpack files with WordPress.com, we sometimes run into issues
because Jetpack and WordPress.com have 2 different functions to check
if a module is active: is_active_module on WordPress.com, is_module_active in Jetpack.

This diff fixes that by adding a new is_module_active function on WordPress.com.

Test Plan:
Once this is merged, we should be able to sync PRs like this one with no issues.
#10120

Differential Revision: https://[private link]

Merges r190254-wpcom.

Testing instructions:

Can you modify your Jetpack settings from Calypso without errors? Especially search/Related Posts.

Proposed changelog entry for your changes:

*none

…ion.

Summary:
When syncing Jetpack files with WordPress.com, we sometimes run into issues
because Jetpack and WordPress.com have 2 different functions to check
if a module is active: `is_active_module` on WordPress.com, `is_module_active` in Jetpack.

This diff fixes that by adding a new `is_module_active` function on WordPress.com.

Test Plan:
Once this is merged, we should be able to sync PRs like this one with no issues.
#10120

Reviewers: dereksmart, kraftbj, mdawaffe, migueluy, jeherve

Reviewed By: dereksmart, kraftbj, mdawaffe

Subscribers: gibrown, mdawaffe, kraftbj

Tags: #touches_jetpack_files

Differential Revision: https://[private link]

Merges r190254-wpcom.
Copy link
Contributor

@kraftbj kraftbj left a comment

Choose a reason for hiding this comment

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

Question regarding this change and if the Jetpack impacts are expected.

$jetpack_search_active = is_jetpack_module_active( 'search', $blog_id );
}
$jetpack_search_active =
$jetpack_search_supported
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like it may be changing the behavior? Before, $jetpack_search_supported is set to false on Jetpack, but it isn't used except in the response of the API. After, it is used in $jetpack_search_active which used to just check if the module was active for a Jetpack site (is_jetpack_module_active is wpcom only).

Copy link
Member Author

Choose a reason for hiding this comment

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

Right. tl;dr with these changes, it's impossible for a Jetpack site to ever be true for $jetpack_search_active

@zinigor can you take a look?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, we'll need to implement something using SAL here, good catch. I'll try to work on that today.

@kraftbj kraftbj added [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. and removed [Status] Needs Review This PR is ready for review. labels Apr 23, 2019
@jetpackbot
Copy link
Collaborator

Thank you for the great PR description!

When this PR is ready for review, please apply the [Status] Needs Review label. If you are an a11n, please have someone from your team review the code if possible. The Jetpack team will also review this PR and merge it to be included in the next Jetpack release.

Scheduled Jetpack release: May 7, 2019.
Scheduled code freeze: April 30, 2019

Generated by 🚫 dangerJS against 1b619fd

@kraftbj kraftbj modified the milestones: 7.3, 7.4 Apr 29, 2019
@jeherve jeherve removed this from the 7.4 milestone May 14, 2019
@zinigor
Copy link
Member

zinigor commented May 14, 2019

Just wanted to comment here to illustrate the point. @jeherve and I have discussed putting this PR on hold because for now we either have to put a temporary fix in, or have a complicated refactor that will touch both sides. So waiting until we figure out the DNA could actually help us understand the direction that we need to take this code in.

@jeherve jeherve removed the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label May 14, 2019
@stale
Copy link

stale bot commented Aug 12, 2019

This PR has been marked as stale. This happened because:

  • It has been inactive in the past 3 months.
  • It hasn’t been labeled `[Pri] Blocker`, `[Pri] High`.

No further action is needed. But it's worth checking if this PR has clear testing instructions, is it up to date with master, and it is still valid. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation.

@stale stale bot added the [Status] Stale label Aug 12, 2019
@dereksmart
Copy link
Member Author

Too old. Will re-open if necessary

@dereksmart dereksmart closed this Aug 10, 2020
@dereksmart dereksmart deleted the sync/class.wpcom-json-api-site-settings-endpoint.phpp branch August 10, 2020 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants