-
Notifications
You must be signed in to change notification settings - Fork 801
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
Full Site Editing: add a is_fse_active
property to the Site object in the REST API
#13196
Conversation
This is an automated check which relies on |
@mattwiebe Would we need to edit |
I'm not certain, possibly? MY |
Alright, thanks for the explanation. I can't seem to be able to get the Customizer link to disappear, even on a WordPress.com site, so I am probably not the best person to keep looking into this. :) I'll let y'all figure this out as you keep working on this and add the conditions you've mentioned for Jetpack sites. |
Yup we'll figure it out, thanks for the ping. :) |
What should our next steps be here in terms of testing? Since that other PR has landed, is there something different we are testing here? |
I need to walk though these steps, but for reviewers I think this can be tested with the following
|
So I'm seeing the following behavior: Single Site RequestA 400 when we forward to the remote site in a @jeherve should I not be testing with Jurassic Ninja here, or should it work? I've connected the site. @mattwiebe would it be possible to please check for server errors here? All SitesOn @mattwiebe any other steps to follow? Maybe I need to simulate an Atomic site here? |
I wonder if there is a difference here between theme names, eg "pub/modern-business" and "modern-business" on the whitelist checks. |
It should work with any site really, JN or an Atomic site. However, as you can see in the error message you get a 500 error from the site. I assume this is because of this: Once you add this function to
I believe that's to be expected, since that's the value that's currently returned in
This would definitely have an impact. If you install a theme from WordPress.com on a Jetpack site, from the Themes screen in Calypso, it will have a slug like |
Had some fun last week with deploy fatals but I'm circling back to this :) |
Ok, 223c5c7268966b607898826e69d2c56f3510a573 should get the job done. I don't know if this has made a mess of sync @jeherve, please let me know if there's a more preferred way of doing this. :) |
If the files are already whitelisted, I think the whole fusion dance is happier starting from a Jetpack PR, which then creates the diff/updates it. |
Still getting a 400 on the single site endpoint and false for me/sites. There might be a separate issues to work on for getting this value to be true, in the right cases for Jetpack sites. |
Hmm I definitely don't get a 400 on a single site endpoint with this branch active, but D31808-code should take care of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if this has made a mess of sync @jeherve
You should be all good on that front 👍.
/me/sites
and/me/site/%s
work well for me now, when I am sandboxed with D31808-code applied. They both returntrue
foris_fse_active
.- I still see the Customize link in Calypso. That seems like a bug, or maybe I am missing something.
- If I try to edit a page, I get the full site editing experience.
Nitpicking and not blocking, but a few minor changes would help us get rid of PHPCS warnings here:
diff --git a/sal/class.json-api-site-jetpack.php b/sal/class.json-api-site-jetpack.php
index 0af76af2a..f13fbbd88 100644
--- a/sal/class.json-api-site-jetpack.php
+++ b/sal/class.json-api-site-jetpack.php
@@ -189,10 +189,11 @@ class Jetpack_Site extends Abstract_Jetpack_Site {
function is_fse_active() {
$fse_enabled = is_plugin_active( 'full-site-editing/full-site-editing-plugin.php' );
- $has_method = method_exists( '\A8C\FSE\Full_Site_Editing', 'is_supported_theme' );
+ $has_method = method_exists( '\A8C\FSE\Full_Site_Editing', 'is_supported_theme' );
if ( $fse_enabled && $has_method ) {
- $fse = \A8C\FSE\Full_Site_Editing::get_instance();
+ $fse = \A8C\FSE\Full_Site_Editing::get_instance();
$slug = get_option( 'stylesheet' );
+
return $fse->is_supported_theme( $slug );
}
return false;
Hmm yeah, as long as we get a Anyway both your suggestions have landed @jeherve |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now. 👍 I'll let someone else review; I can't approve on my own since I created the PR :)
🤔 Maybe just something with my setup then I'm still seeing 400s. @mattwiebe maybe add a screenshot of a good response, and ✅ on the review? |
Go ahead and approve then @mattwiebe, I can see if we can get a +1 on manual testing, but I think this is probably okay |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like @jeherve needs someone else from Automattic/jetpack-crew
to approve but I'm happy with it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…in the REST API Summary: Adding a property to the Site object since 1. the blog-stickers endpoint is only for automattians, and 2. to avoid duplicating theme support logic on the backend and in Calypso Also introduce the `wpcom_is_full_site_editing_active` function and use it to hide the Customizer menu in wp-admin Test Plan: instructions in Automattic/wp-calypso#35106 also: the Customizer menu link should likewise be hidden under the same circumstance in wp-admin Reviewers: #cylon_team, #serenity_team, helpingcat Reviewed By: #serenity_team, helpingcat Subscribers: helpingcat Tags: #touches_jetpack_files Differential Revision: D31148-code This commit syncs r194971-wpcom.
… is populated on the `/rest/v1.2/sites/SITE` endpoint Summary: Should have been included in D31148 for completeness but the bug wasn't exposed due to only testing on `/me/sites` Test Plan: TC Tests, REST API console Reviewers: #cylon_team, vindl Reviewed By: #cylon_team, vindl Tags: #touches_jetpack_files Differential Revision: D31319-code This commit syncs r195033-wpcom.
* check if FSE is active * also check if the theme is supported
b43ab7e
to
2bf46e2
Compare
* 7.7 changelog: initial set of changes * Changelog: add #13154 * Changelog: add #13134 * Changelog: add #12699 and many others * Changelog: add #13127 * Changelog: add #13167 * Changelog: add #13225 * Changelog: add #13179 * Changelog: add #13173 * Changelog: add #13232 * Changelog: add #13137 * Changelog: add #13172 * Changelog: add #13182 * Changelog: add #13200 * Changelog: add #13244 * Changelog: add #13267 * Changelog: add #13204 * changelog: add #13205 * Changelog: add #13183 * Changelog: add #13278 * Changelog: add #13162 * Changelog: add #13268 * Changelog: add #13286 * Changelog: add #13273 * Changelog: add #12474 * Changelog: add #13085 * Changelog: add #13266 * Changelog: add #13306 * Changelog: add #13311 * Changelog: add #13302 * Changelog: add #13196 * Changelog: add #12733 * Changelog: add #13261 * Changelog: add #13322 * Changelog: add #13333 * Changelog: add #13335
Changes proposed in this Pull Request:
Adding a property to the Site object since 1. the blog-stickers endpoint is only for automattians, and 2. to avoid duplicating theme support logic on the backend and in Calypso
Also introduce the
wpcom_is_full_site_editing_active
function and use it to hide the Customizer menu in wp-adminReviewers: #cylon_team, #serenity_team, helpingcat
Reviewed By: #serenity_team, helpingcat
Subscribers: helpingcat
Tags: #touches_jetpack_files
Differential Revision: D31148-code, D31319-code
This commit syncs r194971-wpcom and r195033-wpcom.
Testing instructions:
Instructions in Automattic/wp-calypso#35106
also: the Customizer menu link should likewise be hidden under the same circumstance in wp-admin
Proposed changelog entry for your changes: