Skip to content

Fix Quote block transform error when no paragraph blocks exist#74320

Closed
sarthak-19 wants to merge 1 commit into
WordPress:trunkfrom
sarthak-19:fix/quote_to_para_bugfix
Closed

Fix Quote block transform error when no paragraph blocks exist#74320
sarthak-19 wants to merge 1 commit into
WordPress:trunkfrom
sarthak-19:fix/quote_to_para_bugfix

Conversation

@sarthak-19
Copy link
Copy Markdown

@sarthak-19 sarthak-19 commented Jan 1, 2026

What?

Fixes #74236 a TypeError that occurs when attempting to transform a Quote block to paragraphs when the Quote block doesn't contain any paragraph inner blocks.

Why?

The transform function was incorrectly accessing block data:

  • Used non-existent value attribute instead of innerBlocks parameter
  • The isMatch function wasn't properly validating the presence of paragraph blocks
  • This caused a null reference error: Cannot read properties of null (reading 'name')

How

  • Fixed isMatch validation: Now correctly checks block.innerBlocks to verify at least one paragraph block exists before allowing the transform.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 1, 2026

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Required label: Any label starting with [Type].
  • Labels found: [Feature] Block Transforms, [Package] Block library, [Block] Quote, First-time Contributor.

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

@github-actions github-actions Bot added the [Package] Block library /packages/block-library label Jan 1, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 1, 2026

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: sarthak-19 <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions github-actions Bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Jan 1, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 1, 2026

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @sarthak-19! In case you missed it, we'd love to have you join us in our Slack community.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@t-hamano t-hamano added [Feature] Block Transforms Block transforms from one block to another [Block] Quote Affects the Quote Block labels Jan 2, 2026
@t-hamano
Copy link
Copy Markdown
Contributor

t-hamano commented Jan 2, 2026

@sarthak-19 Thanks for the PR!

Sorry, but let me close this PR since there is already an ongoing #74236.

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

Labels

[Block] Quote Affects the Quote Block [Feature] Block Transforms Block transforms from one block to another First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Package] Block library /packages/block-library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quote: Transform cannot be performed when it does not contain a paragraph block.

2 participants