This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 219
Fix id generation for template from file #5399 #5409
Closed
Closed
Conversation
This file contains 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
Fix id generation for template from file
rubikuserbot
requested review from
a team and
Aljullu
and removed request for
a team
December 17, 2021 12:48
Size Change: 0 B Total Size: 819 kB ℹ️ View Unchanged
|
This PR has been marked as If deemed still relevant, the pr can be kept active by ensuring it's up to date with the main branch and removing the stale label - otherwise it will automatically be closed after 10 days. |
github-actions
bot
added
the
status: stale
Stale issues and PRs have had no updates for 60 days.
label
Feb 16, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
In according with the function
get_block_template
, the system gets thetheme
value from theid
. In the previous implementation, the id waswoocommerce//${slug}
. So the calculated theme waswoocommerce
. The problem was that the theme value for our template iswoocommerce/woocommerce
. So the query could not find the post and it loaded always the template from the file.This pr fixes the generation id. Now the id is
woocommerce/wocoomerce//${slug}
.Question
Are we sure that it is the best solution to adopt
woocommerce/woocommerce
like theme value?From what I understand GB and our code work a lot with the id (for example with
explode
PHP function).It can be tricky for potential future regexes, but also for debugging work with an id like this
woocommerce/wocoomerce//${slug}
Fixes #5399
Testing
Manual Testing
How to test the changes in this Pull Request:
Check out this branch. Be sure that you have:
WordPress 5.9
,Gutenberg trunk version
,WooCommerce 6.0.0
, andWooCommerce Blocks trunk
Template Page
onFull Site Editor
.WooCommerce template
likeSingle Product Page
.