Skip to content

Update the block theme folders to be templates and parts#1932

Closed
youknowriad wants to merge 3 commits intoWordPress:trunkfrom
youknowriad:update/block-theme-folders
Closed

Update the block theme folders to be templates and parts#1932
youknowriad wants to merge 3 commits intoWordPress:trunkfrom
youknowriad:update/block-theme-folders

Conversation

@youknowriad
Copy link
Copy Markdown
Contributor

Backport the theme folders change from the Gutenberg plugin.

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

@ockham
Copy link
Copy Markdown
Contributor

ockham commented Nov 23, 2021

Gutenberg counterpart PR: WordPress/gutenberg#36647

@ockham
Copy link
Copy Markdown
Contributor

ockham commented Nov 23, 2021

This LGTM. Unfortunately, I can't currently test manually (some issue with MySQL in my local dev setup, probably yet another collision with my GB dev setup 🙄 ).

Instead, I've tested these changes on top of #1920 (by running unit tests), and they're unfortunately failing 😕

There were 3 failures:

1) Block_Template_Test::test_child_theme_block_template_takes_precedence_over_equally_specific_parent_theme_php_template
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'/var/www/src/wp-includes/template-canvas.php'
+'/var/www/tests/phpunit/includes/../data/themedir1/block-theme/page-1.php'

/var/www/tests/phpunit/tests/block-template.php:153

2) Block_Template_Test::test_custom_page_block_template_takes_precedence_over_all_other_templates
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'Content'
+'<!-- wp:paragraph -->
+<p>Page Template</p>
+<!-- /wp:paragraph -->'

/var/www/tests/phpunit/tests/block-template.php:193

Would it make sense to get #1920 in first for added confidence?

@youknowriad youknowriad force-pushed the update/block-theme-folders branch from 302b07b to ee50f39 Compare November 25, 2021 09:58
Copy link
Copy Markdown
Contributor

@ockham ockham left a comment

Choose a reason for hiding this comment

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

Looking good! Thanks Riad 👍

@youknowriad
Copy link
Copy Markdown
Contributor Author

@youknowriad youknowriad deleted the update/block-theme-folders branch November 25, 2021 10:58
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.

2 participants