Conversation
This was referenced Apr 8, 2021
|
Size Change: 0 B Total Size: 1.42 MB ℹ️ View Unchanged
|
bobbingwide
reviewed
Apr 8, 2021
Contributor
bobbingwide
left a comment
There was a problem hiding this comment.
Note that there's another couple of wes in the original comment.
youknowriad
approved these changes
Apr 8, 2021
Contributor
youknowriad
left a comment
There was a problem hiding this comment.
This makes me wonder whether the logic to get the right template should be "merged" between block templates and php templates.
In other words instead of looping through the templates for php and then for html do it once and return the higher priority one starting with html.
Anyway such refactor could be considered separately.
Contributor
This makes me wonder what the Site Editor is supposed to do when it finds a |
This was referenced May 4, 2021
ockham
added a commit
that referenced
this pull request
May 12, 2021
The block template resolution algorithm is quite complex, as it has to cover quite a lot of different possible cases resulting from various combinations of - WP's "old" template hierarchy (including custom page templates, and child themes) - block templates. Things become especially complex when there are e.g. "oldschool" PHP templates with higher specificity than the available block templates; or when a child theme has a PHP template with equal specificity as the parent theme's corresponding block template. For more discussion on this, see #31399. Examples of previous iterations that sought to refine the algorithms' behavior include #29026, #30599, #31123, and #31336. This PR's goal is to eventually cover all of those cases.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #30565 and bobbingwide/fizzie#58
The problem was that there was no
breakin the loop, so.htmltemplates with a higher specificity than.phptemplates were not properly detected.Checklist:
*.native.jsfiles for terms that need renaming or removal).