Skip to content

Fix block registration from metadata #3501

Closed
aristath wants to merge 45 commits into
WordPress:trunkfrom
aristath:fix/block-registration
Closed

Fix block registration from metadata #3501
aristath wants to merge 45 commits into
WordPress:trunkfrom
aristath:fix/block-registration

Conversation

@aristath
Copy link
Copy Markdown
Member

Trac ticket: https://core.trac.wordpress.org/ticket/56865


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

Copy link
Copy Markdown
Member Author

@aristath aristath left a comment

Choose a reason for hiding this comment

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

Adding some notes regarding the changes done in this PR

Comment thread src/wp-includes/blocks.php Outdated
Comment thread src/wp-includes/blocks.php
Comment thread src/wp-includes/blocks.php Outdated
Comment thread src/wp-includes/blocks.php
Comment thread src/wp-includes/blocks.php Outdated
Comment thread src/wp-includes/blocks.php
@aristath aristath marked this pull request as ready for review October 20, 2022 07:14
Copy link
Copy Markdown
Member

@mukeshpanchal27 mukeshpanchal27 left a comment

Choose a reason for hiding this comment

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

Left one minor feedback.

Comment thread src/wp-includes/blocks.php
@aristath aristath force-pushed the fix/block-registration branch from 99e2cbe to d2f4977 Compare March 2, 2023 09:17
aristath and others added 3 commits March 2, 2023 11:17
Co-authored-by: Mukesh Panchal <mukeshpanchal27@users.noreply.github.com>
@aristath
Copy link
Copy Markdown
Member Author

aristath commented Mar 2, 2023

Added PHPUnit tests and fixed issues that surfaced from said tests.

Comment thread tests/phpunit/tests/blocks/register.php Outdated
Copy link
Copy Markdown
Contributor

@costdev costdev left a comment

Choose a reason for hiding this comment

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

Thanks for the tests @aristath! I've left a few thoughts in this review. 🙂

Comment thread tests/phpunit/tests/blocks/register.php Outdated
Comment thread tests/phpunit/tests/blocks/register.php
Comment thread tests/phpunit/tests/blocks/register.php Outdated
Comment thread tests/phpunit/tests/blocks/register.php Outdated
aristath and others added 5 commits March 2, 2023 12:11
Co-authored-by: Colin Stewart <79332690+costdev@users.noreply.github.com>
Co-authored-by: Colin Stewart <79332690+costdev@users.noreply.github.com>
Comment thread tests/phpunit/tests/blocks/register.php
aristath and others added 3 commits July 10, 2023 10:12
Comment thread tests/phpunit/tests/blocks/register.php
Co-authored-by: Mukesh Panchal <mukeshpanchal27@users.noreply.github.com>
Copy link
Copy Markdown
Member

@spacedmonkey spacedmonkey left a comment

Choose a reason for hiding this comment

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

Please consider 0bfc842. This change will revert this change.

@aristath
Copy link
Copy Markdown
Member Author

Please consider 0bfc842. This change will revert this change.

Can you please elaborate? How does it revert that change? I don't see it 🤔

@spacedmonkey
Copy link
Copy Markdown
Member

Can you please elaborate? How does it revert that change? I don't see it 🤔

In 0bfc842, I made it so the file_exists is not run on the core blocks. The file exists is pointless as it always exists and ends up I/O. In this PR, you move the file_exists out the if statement, make it run again always, reverting my change.

Comment thread src/wp-includes/blocks.php
Comment thread src/wp-includes/blocks.php
Comment thread tests/phpunit/tests/blocks/register.php
Comment thread src/wp-includes/blocks.php Outdated
Comment thread src/wp-includes/blocks.php
Comment thread src/wp-includes/blocks.php Outdated
Copy link
Copy Markdown
Member

@spacedmonkey spacedmonkey 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.

@spacedmonkey
Copy link
Copy Markdown
Member

@aristath Is this good to commit.

@aristath
Copy link
Copy Markdown
Member Author

Yes, it is. 👍

@SergeyBiryukov
Copy link
Copy Markdown
Member

Thanks for the PR! Merged in r57026.

@aristath aristath deleted the fix/block-registration branch October 30, 2023 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants