-
Notifications
You must be signed in to change notification settings - Fork 219
Update WooCommerce plugin slug for Block Templates #5519
Conversation
Size Change: 0 B Total Size: 819 kB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is testing well and code looks good, thanks for investigating @tjcafferkey!
If the site has DB entries using the old slug and the new slug:
We will have to find theterm_id
for the old slug and update all entries using it to use the new slugsterm_id
.If the site has DB entries just using the old slug:
We can simply update the old slug row inwp_terms
To help me understand the urgency of this: with your fix in this PR, we are reading templates from the old and the new slugs, right? If that's the case, my understanding is that the database migration is not be really urgent, correct? It would just be a clean-up so we don't need to account for the old slug in new code we write, but that's all. Am I right?
Yeah that is correct @Aljullu. It's no longer as urgent and likely won't effect that many sites assuming the feature isn't widely adopted yet. I will merge this, and create a new issue about this migration and reference this PR and the original issue for context. Thanks for testing! |
* Empty commit for release pull request * Query legacy and correct plugin slug for WooCommerce block templates (#5519) * Update readme.txt for 6.5.2 changelog * Add testing notes for 6.5.2 * Update testing instructions * Update version to 6.5.2-dev * Update testing zip for 6.5.2 * Bumping version strings to new version. Co-authored-by: github-actions <[email protected]> Co-authored-by: Tom Cafferkey <[email protected]> Co-authored-by: Michael P. Pfeiffer <[email protected]>
Description
Use the correct WooCommerce plugin slug
woocommerce/woocommerce
instead of the current incorrect onewoocommerce
. However, we are maintaining the old slug until we deploy a migration script to update the DB entires.Consequences of this approach
If the site has DB entries using the old slug and the new slug:
We will have to find the
term_id
for the old slug and update all entries using it to use the new slugsterm_id
.If the site has DB entries just using the old slug:
We can simply update the old slug row in
wp_terms
From:
name:
WooCommerce
slug:
woocommerce
To:
name:
woocommerce/woocommerce
slug:
woocommerce-woocommerce
Fixes #5423
Fixes #5327
Testing
How to test the changes in this Pull Request:
Note: This is mostly regression testing.
archive-product.html
template in your theme and ensure this overrides the default one provided by WooCommerce. Check this also renders correctly on the frontend and within the site editor.archive-product.html
provided by your theme, ensure on the Site Editor > Templates list you are still seeing the customised template in this list and it renders correctly on the frontend, and in site editor.archive-product.html
template to ensure this works correctly.Performance Impact
We are querying both the old and the new slugs for customised templates which have been saved in the database. This will be resolved later using a migration script described above in this PR.