Skip to content

Re-enable passing post_id query arg for Server Side Rendering (#31786)#31787

Merged
Mamaduka merged 1 commit intoWordPress:trunkfrom
bobbingwide:fix/31786
May 19, 2021
Merged

Re-enable passing post_id query arg for Server Side Rendering (#31786)#31787
Mamaduka merged 1 commit intoWordPress:trunkfrom
bobbingwide:fix/31786

Conversation

@bobbingwide
Copy link
Copy Markdown
Contributor

Description

A change in PR #29246 altered a test so that it always failed.
It was testing typeof currentPostId.id which was undefined; in the block editor currentPostId is an integer.

Blocks which were Server Side Rendered and relied on the post_id being passed in the REST request were failing to return anything. They still worked when rendered for the front end.

I deleted three characters: .id.

How has this been tested?

  • In a local development environment with the sb-children-block plugin.
  • Tested in the block editor - see screenshot
  • Tested in the site editor

Screenshots

image

Types of changes

Fixes a regression introduced in Gutenberg 10.4.0 by PR #29246

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).

@bobbingwide
Copy link
Copy Markdown
Contributor Author

Here's the screen capture of the Site editor. I changed the Depth parameter. The Request URL doesn't contain the post_id query arg. The block returns an empty list since it has no post parent to find the children of.

image

@Mamaduka Mamaduka added [Package] Server Side Render /packages/server-side-render [Type] Regression Related to a regression in the latest release labels May 14, 2021
Copy link
Copy Markdown
Member

@Mamaduka Mamaduka left a comment

Choose a reason for hiding this comment

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

Looks good to me ✅

Thanks for fixing this @bobbingwide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Server Side Render /packages/server-side-render [Type] Regression Related to a regression in the latest release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants