refactor(2meet-data-optimizer): list post groups for backfill from the registry

- Admin "backfill all" and `wp tmdo post-migrate-group` take any registered post group via TMDO_Post_Migration::backfillable_groups() instead of a hard-coded list of 7 (dev36 registers 11; the 4 HP add-on groups were never backfilled). Restored orphan groups are excluded and rejected — their values live only in the flat table.
- Groups with json fields (attachment, nav_menu_item) go row by row through the migration engine instead of leaving the json columns NULL in the bulk pivot.
- Verify: PostBackfillJsonTest (3 RED on hardening/2.2); dev36 post-migrate-group attachment / nav_menu_item / hp_draft_flags: json columns semantically equal native (24/24, 21/21), checker unchanged.
- PR: PR-067
This commit is contained in:
2026-09-26 22:54:27 +08:00
parent 13ea341ef8
commit 7807eae957
4 changed files with 82 additions and 25 deletions
+2 -2
View File
@@ -556,11 +556,11 @@ class TMDO_Admin {
exit;
}
// v2.10.0: Post Migration Wizard — backfill all 7 groups.
// v2.10.0: Post Migration Wizard — backfill every registered post group.
if ( isset( $_POST['wpdo_post_backfill_all'] ) && check_admin_referer( 'wpdo_post_backfill_all' ) && class_exists( 'TMDO_Post_Migration' ) ) {
$total_migrated = 0;
$errors = array();
foreach ( array( 'wp_core', 'attachment', 'wc_product', 'hp_listing_core', 'hp_request_core', 'hp_vendor_core', 'nav_menu_item' ) as $group ) {
foreach ( TMDO_Post_Migration::backfillable_groups() as $group ) {
try {
$result = TMDO_Post_Migration::backfill_group( $group );
$total_migrated += (int) $result['migrated'];