Skip to content

fix: Pass null post ID for local drafts in GutenbergKit#22580

Merged
jkmassel merged 1 commit intointegrate/gutenberg-preloadingfrom
fix/draft-post-id-for-gutenbergkit
Feb 10, 2026
Merged

fix: Pass null post ID for local drafts in GutenbergKit#22580
jkmassel merged 1 commit intointegrate/gutenberg-preloadingfrom
fix/draft-post-id-for-gutenbergkit

Conversation

@dcalhoun
Copy link
Member

Description

Local draft posts have remotePostId defaulting to 0 (Java's long default), which was passed directly to GutenbergKit's setPostId(). GBK expects null for unsaved posts, but was receiving 0 instead.

This change checks isLocalDraft and passes null to setPostId() for local drafts, ensuring the GBK webview correctly identifies new/unsaved posts.

Testing instructions

Open a new draft post in GutenbergKit:

  1. Create a new post using the GutenbergKit (experimental) editor
  2. Inspect the webview configuration
  • Verify the post ID is null (not 0) in the GBK webview

Open an existing published post in GutenbergKit:

  1. Open an existing published post in the GutenbergKit editor
  • Verify the post ID is the correct remote post ID (not null)

Local draft posts have remotePostId defaulting to 0, which was
passed directly to GutenbergKit's setPostId(). GBK expects null
for unsaved posts. Now check isLocalDraft and pass null instead.
@sonarqubecloud
Copy link

@dcalhoun dcalhoun marked this pull request as ready for review February 10, 2026 17:42
@dcalhoun dcalhoun requested a review from jkmassel February 10, 2026 17:42
@dcalhoun dcalhoun added [Type] Bug Posting/Editing Gutenberg Editing and display of Gutenberg blocks. labels Feb 10, 2026
@wpmobilebot
Copy link
Contributor

App Icon📲 You can test the changes from this Pull Request in WordPress Android by scanning the QR code below to install the corresponding build.

App NameWordPress Android
FlavorJalapeno
Build TypeDebug
Versionpr22580-cd82adf
Build Number1484
Application IDorg.wordpress.android.prealpha
Commitcd82adf
Installation URL449t7vds7bue8
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

App Icon📲 You can test the changes from this Pull Request in Jetpack Android by scanning the QR code below to install the corresponding build.

App NameJetpack Android
FlavorJalapeno
Build TypeDebug
Versionpr22580-cd82adf
Build Number1484
Application IDcom.jetpack.android.prealpha
Commitcd82adf
Installation URL0gkgd2rpavdqg
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

🤖 Build Failure Analysis

This build has failures. Claude has analyzed them - check the build annotations for details.

@jkmassel jkmassel merged commit 6b97022 into integrate/gutenberg-preloading Feb 10, 2026
23 of 29 checks passed
@jkmassel jkmassel deleted the fix/draft-post-id-for-gutenbergkit branch February 10, 2026 19:55
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. Posting/Editing [Type] Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants