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

Fix - EditPostActivity - Update fetching for the block editor's settings logic #21016

Merged
merged 1 commit into from
Jun 24, 2024

Conversation

geriux
Copy link
Contributor

@geriux geriux commented Jun 24, 2024

Fixes #21005

It appears the /wp/v2/themes?status=active endpoint is not returning any data for self-hosted sites, from my debugging the API call it's returning is Sorry, you are not allowed to view the active theme.

This endpoint is available in WordPress core so there must be something wrong with the authentication of this call.

As a workaround, this PR disables calling the following endpoints within the editor:

  • wp-block-editor/v1/settings?context=mobile
  • /wp/v2/themes?status=active

The first one is only available for Dotcom or Jetpack-connected sites with the Gutenberg plugin activated.

If the first one is unavailable, it fetches the current active theme to get its colors. This one is currently failing and blocking the Editor's UI and functionality.

Disabling these calls for self-hosted sites won't affect the editor's functionality.


To Test:

Self-hosted site (without Jetpack and the Gutenberg plugin)

  • Install the app (Fresh install)
  • Log in using a self-hosted site (without Jetpack and the Gutenberg plugin)
  • Open the editor
  • Expect to be able to set a title and content, try adding different blocks: Paragraphs, Headings, Gallery
  • Expect to not see your theme's background and text color in the editor's canvas.

Self-hosted site (with Jetpack and the Gutenberg plugin)

  • Install the app (Fresh install)
  • Log in using a self-hosted site (with Jetpack and the Gutenberg plugin)
  • Open the editor
  • Expect to be able to set a title and content, try adding different blocks: Paragraphs, Headings, Gallery
  • Expect to see your theme's background and text color in the editor's canvas.

Simple sites

  • Install the app (Fresh install)
  • Log in using a simple site
  • Open the editor
  • Expect to be able to set a title and content, try adding different blocks: Paragraphs, Headings, Gallery
  • Expect to see your theme's background and text color in the editor's canvas.

Atomic sites

  • Install the app (Fresh install)
  • Log in using an Atomic site
  • Open the editor
  • Expect to be able to set a title and content, try adding different blocks: Paragraphs, Headings, Gallery
  • Expect to see your theme's background and text color in the editor's canvas.
Before After
BugFixBeforeAndroid.mov
AfterFixAndroid.mov

Regression Notes

  1. Potential unintended areas of impact

    • It only affects the editor.
  2. What I did to test those areas of impact (or what existing automated tests I relied on)

    • Manual testing.
  3. What automated tests I added (or what prevented me from doing so)

    • No new tests added, relied on manual testing to fix the current bug.

PR Submission Checklist:

  • I have completed the Regression Notes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

Testing Checklist (strike-out the not-applying and unnecessary ones):

  • WordPress.com sites and self-hosted Jetpack sites.
  • Portrait and landscape orientations.
  • Light and dark modes.
  • Fonts: Larger, smaller and bold text.
  • High contrast.
  • Talkback.
  • Languages with large words or with letters/accents not frequently used in English.
  • Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)
  • Large and small screen sizes. (Tablet and smaller phones)
  • Multi-tasking: Split screen and Pop-up view. (Android 10 or higher)

@dangermattic
Copy link
Collaborator

1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

Copy link

sonarcloud bot commented Jun 24, 2024

@wpmobilebot
Copy link
Contributor

Jetpack📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack Jetpack
FlavorJalapeno
Build TypeDebug
Versionpr21016-42bebe3
Commit42bebe3
Direct Downloadjetpack-prototype-build-pr21016-42bebe3.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

WordPress📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress WordPress
FlavorJalapeno
Build TypeDebug
Versionpr21016-42bebe3
Commit42bebe3
Direct Downloadwordpress-prototype-build-pr21016-42bebe3.apk
Note: Google Login is not supported on these builds.

@twstokes
Copy link
Contributor

👋 Just wanted to chime in that when I retest the self-hosted editor issue with 42bebe3 I couldn't reproduce it. I didn't test the other scenarios (with Jetpack, Dotcom), though.

@geriux geriux requested a review from dcalhoun June 24, 2024 16:35
@geriux geriux added this to the 25.1 ❄️ milestone Jun 24, 2024
@geriux geriux added [Type] Bug Themes Gutenberg Editing and display of Gutenberg blocks. labels Jun 24, 2024
@geriux geriux marked this pull request as ready for review June 24, 2024 16:35
Copy link
Member

@dcalhoun dcalhoun left a comment

Choose a reason for hiding this comment

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

Test plan succeeded for me on a Samsung Galaxy S20. Thank you for addressing this. 🚀

@geriux geriux merged commit 23a9e5d into release/25.1 Jun 24, 2024
24 checks passed
@geriux geriux deleted the fix/editor-theme-self-hosted branch June 24, 2024 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gutenberg Editing and display of Gutenberg blocks. Themes [Type] Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants