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
Add migration strategy and load blockified templates #6538
Merged
Merged
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
Size Change: 0 B Total Size: 875 kB ℹ️ View Unchanged
|
albarin
changed the title
Feature/6513 load blockified templates
POC: Feature/6513 load blockified templates
Jun 13, 2022
…mplates` flag If the schema version stored on the db is <= 260 means the plugin is being updated to the new version and we should keep using the old templates, not the blockified ones.
start loading the blockified templates or not.
albarin
force-pushed
the
feature/6513-load-blockified-templates
branch
from
June 14, 2022 14:44
07c151a
to
2a188a1
Compare
gigitux
force-pushed
the
feature/6513-load-blockified-templates
branch
from
June 16, 2022 16:22
42cdb5a
to
545efaf
Compare
…ocks into feature/6513-load-blockified-templates
… depending on the option
albarin
force-pushed
the
feature/6513-load-blockified-templates
branch
from
June 17, 2022 10:03
a7bb2cc
to
e4c463c
Compare
gigitux
force-pushed
the
feature/6513-load-blockified-templates
branch
from
June 22, 2022 08:18
49c66fb
to
e6c65a1
Compare
rubikuserbot
requested review from
a team and
gigitux
and removed request for
a team
June 27, 2022 12:54
gigitux
requested review from
a team and
frontdevde
and removed request for
gigitux and
a team
June 27, 2022 12:57
I removed myself as a reviewer because I worked on this PR. |
…ocks into feature/6513-load-blockified-templates
frontdevde
approved these changes
Jul 5, 2022
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.
Thanks for getting this in place! 👏
Was a journey to review but we got there. Glad to confirm it's working as expected. ✅
tjcafferkey
reviewed
Feb 1, 2023
* @param \WP_Theme $old_theme Instance of the old theme. | ||
* @return void | ||
*/ | ||
public function check_should_use_blockified_product_grid_templates( $old_name, $old_theme ) { |
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.
I wonder if we can optimize by creating a more abstract method which accepts the option
key so we are able to use it for future templates we are going to convert to block templates to avoid creating separate methods for each scenario?
7 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
focus: template
Related to API powering block template functionality in the Site Editor
skip-changelog
PRs that you don't want to appear in the changelog.
type: enhancement
The issue is a request for an enhancement.
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.
Fixes #6513
The goal of this PR is to render the new blockied Product Grid block (when it will be ready), only when the user:
and don't have a customized template.
In this table, you can see the expected behavior for the different cases:
To reach this goal, we created a new class
Migration
that set the optionwc_blocks_use_blockified_product_grid_block_as_template
to no (this code will be enabled when the new block will be released).In the class
BlockTemplatesController
we render the new template only if the optionwc_blocks_use_blockified_product_grid_block_as_template
is set to yes.We added unit tests for the
Migration
class and for theBlockTemplatesUtils
class.Testing
Automated Tests
User Facing Testing
Download zips:
Please, don't rename the name of the zip.
For convenience, in the testing instructions:
pre-update package
for the zip generated from the current trunk branch.after-update package
for the zip generated from the PR.Test 1:
after-update package
.Product Catalog
,Product Search Results
,Products by Category
andProducts by Tag
renders aParagraph block
(it is just a placeholder).Test 2:
after-update package
.Product Catalog
,Product Search Results
,Products by Category
andProducts by Tag
renders aParagraph block
(it is just a placeholder).Test 3:
pre-update package
.Product Catalog
,Product Search Results
,Products by Category
andProducts by Tag
renders the classicWooCommerce Product Grid Block
.after-update package
.wp_option
there is a keywc_blocks_use_blockified_product_grid_block_as_template
set tono
.Product Catalog
,Product Search Results
,Products by Category
andProducts by Tag
renders the classicWooCommerce Product Grid Block
.wc_blocks_use_blockified_product_grid_block_as_template
and the keywc_blocks_version
from the database and remove the plugin.Test 4:
pre-update package
.after-update package
.wp_option
there is a keywc_blocks_use_blockified_product_grid_block_as_template
set toyes
.Product Catalog
,Product Search Results
,Products by Category
, andProducts by Tag
renders aParagraph block
(it is just a placeholder).wc_blocks_use_blockified_product_grid_block_as_template
and the keywc_blocks_version
from the database and remove the plugin.Unit Test Fix
We fixed #6618. We noticed that the command
pretest:php
was executed in another container and break some references in thephpunit
container. We decide to remove the command: now, before runningnpm run php:test
the user must install PHP deps.Test:
Be sure that PHP unit tests don't fail.
WooCommerce Visibility