From 41a2007c981c59b33a7851195f3e390aa07054a0 Mon Sep 17 00:00:00 2001 From: Francesco Bigiarini Date: Wed, 18 Dec 2024 10:40:30 +0100 Subject: [PATCH] Fix: serialized term meta --- .../data-liberation/src/import/WP_Entity_Importer.php | 2 +- .../data-liberation/tests/WPTopologicalSorterTests.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/playground/data-liberation/src/import/WP_Entity_Importer.php b/packages/playground/data-liberation/src/import/WP_Entity_Importer.php index 439e6d511d..1ee1c2b873 100644 --- a/packages/playground/data-liberation/src/import/WP_Entity_Importer.php +++ b/packages/playground/data-liberation/src/import/WP_Entity_Importer.php @@ -456,7 +456,7 @@ public function import_term_meta( $meta_item, $term_id ) { $term_meta_id = add_term_meta( $meta_item['term_id'], wp_slash( $meta_item['meta_key'] ), wp_slash_strings_only( $value ) ); do_action( 'wxr_importer_processed_term_meta', $term_meta_id, $meta_item, $meta_item['term_id'] ); - $this->topological_sorter->map_entity( 'term_meta', $meta_item, $term_meta_id, $meta_item['term_id'] ); + $this->topological_sorter->map_entity( 'term_meta', $meta_item, $meta_item['meta_key'] ); } /** diff --git a/packages/playground/data-liberation/tests/WPTopologicalSorterTests.php b/packages/playground/data-liberation/tests/WPTopologicalSorterTests.php index e5885a8ea2..62eb975dbd 100644 --- a/packages/playground/data-liberation/tests/WPTopologicalSorterTests.php +++ b/packages/playground/data-liberation/tests/WPTopologicalSorterTests.php @@ -331,7 +331,7 @@ public function test_serialized_postmeta_with_slashes() { * * @see https://github.com/WordPress/wordpress-importer/blob/master/phpunit/tests/term-meta.php */ - public function _no_test_serialized_term_meta() { + public function test_serialized_term_meta() { register_taxonomy( 'custom_taxonomy', array( 'post' ) ); $this->import_wxr_file( __DIR__ . '/wxr/test-serialized-term-meta.xml' );