Skip to content

Commit 02463fb

Browse files
committed
Sync
Fixes #14752 Use a consistent table id when syncing terms.
1 parent 81f7ec4 commit 02463fb

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/sync/src/modules/class-terms.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function name() {
3434
* @return string
3535
*/
3636
public function id_field() {
37-
return 'term_id';
37+
return 'term_taxonomy_id';
3838
}
3939

4040
/**

tests/php/sync/test_class.jetpack-sync-terms.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function tearDown() {
4545
public function test_insert_term_is_synced() {
4646
$terms = $this->get_terms();
4747
$server_terms = $this->server_replica_storage->get_terms( $this->taxonomy );
48-
$this->assertEqualsObject( $terms, $server_terms );
48+
$this->assertEqualsObject( $terms, $server_terms, 'Synced terms do not match local terms.' );
4949

5050
$event_data = $this->server_event_storage->get_most_recent_event( 'jetpack_sync_add_term' );
5151
$this->assertTrue( (bool) $event_data );
@@ -61,7 +61,7 @@ public function test_update_term_is_synced() {
6161

6262
$terms = $this->get_terms();
6363
$server_terms = $this->server_replica_storage->get_terms( $this->taxonomy );
64-
$this->assertEqualsObject( $terms, $server_terms );
64+
$this->assertEqualsObject( $terms, $server_terms, 'Synced terms do not match local terms.' );
6565
}
6666

6767
public function test_delete_term_is_synced() {
@@ -80,7 +80,7 @@ public function test_added_terms_to_post_is_synced() {
8080

8181
$object_terms = get_the_terms( $this->post_id, $this->taxonomy );
8282
$server_object_terms = $this->server_replica_storage->get_the_terms( $this->post_id, $this->taxonomy );
83-
$this->assertEqualsObject( $object_terms, $server_object_terms );
83+
$this->assertEqualsObject( $object_terms, $server_object_terms, 'Synced terms do not match local terms.' );
8484
}
8585

8686
public function test_added_terms_to_post_is_synced_appended() {
@@ -94,7 +94,7 @@ public function test_added_terms_to_post_is_synced_appended() {
9494
$object_terms = get_the_terms( $this->post_id, $this->taxonomy );
9595
$server_object_terms = $this->server_replica_storage->get_the_terms( $this->post_id, $this->taxonomy );
9696
$server_object_terms = array_reverse( $server_object_terms );
97-
$this->assertEqualsObject( $object_terms, $server_object_terms );
97+
$this->assertEqualsObject( $object_terms, $server_object_terms, 'Synced terms do not match local terms.' );
9898
}
9999

100100
public function test_deleted_terms_to_post_is_synced() {
@@ -112,7 +112,7 @@ public function test_deleted_terms_to_post_is_synced() {
112112
$server_object_terms = $this->server_replica_storage->get_the_terms( $this->post_id, $this->taxonomy );
113113
$server_object_terms = array_reverse( $server_object_terms );
114114

115-
$this->assertEqualsObject( $object_terms, $server_object_terms );
115+
$this->assertEqualsObject( $object_terms, $server_object_terms, 'Synced terms do not match local terms.' );
116116
}
117117

118118
public function test_delete_object_term_relationships() {

0 commit comments

Comments
 (0)