-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Site Editor: Fix _wp_file_based term deletion in migration #28300
Conversation
Size Change: +1.2 kB (0%) Total Size: 1.28 MB
ℹ️ View Unchanged
|
Worked for me. Is there any chance that |
@@ -49,14 +49,17 @@ function _gutenberg_migrate_remove_fse_drafts() { | |||
} | |||
|
|||
// Delete _wp_file_based term. | |||
$term = get_term_by( 'name', '_wp_file_based', 'wp-theme' ); | |||
$term = get_term_by( 'name', '_wp_file_based', 'wp_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.
😅
Thanks for testing!
I like the idea -- it also would make it less easy to confuse the option with the eponymous code constant. @youknowriad Would you be okay with that? |
Makes sense, but we should keep the const as is. |
* Hook into `init` instead of `plugins_loaded`. * Fix typo in taxonomy (`wp-theme` -> `wp_theme`). * Rename option to `gutenberg_version_migration` to conform with usual convention, and to distinguish from `_GUTENBERG_VERSION_MIGRATION` constant.
Cherry-picked to |
Description
Purports to fix #28155 🤞
The reason for this is twofold:
plugins_loaded
. However, thewp_theme
taxonomy was only registered uponinit
(see Database migration didn't work properly #28155 (comment)).wp-theme
(dash) rather than thewp_theme
(underscore) taxonomy (see Database migration didn't work properly #28155 (comment)).How has this been tested?
Make sure you have a
_wp_file_based
term (in thewp_theme
taxonomy) lying around from a run of the Site Editor prior to GB 9.8. To verify that you do have one, run(If this comes back empty, downgrade your version of Gutenberg to 9.7 (e.g.
git checkout release/9.7 && npm run build
), install and activate an FSE-enabled theme, and load the Site Editor. Run the above WP CLI command again to verify that it worked.)Assuming that that object is present:
_GUTENBERG_VERSION_MIGRATION
option in order to have the migration triggered:npm run wp-env run cli "wp option delete _GUTENBERG_VERSION_MIGRATION"
init
hook, and thus, the migration.)_wp_file_based
term is gone by once again running:Types of changes
Bug fix
cc/ @carlomanf for review 🙂