Skip to content

Commit 31e8fd8

Browse files
darssenmatticbot
authored andcommitted
Full Sync: Consider blacklisted taxonomies when getting next chunk in term relationships (#42618)
* Consider blacklisted taxonomies when getting next chunk for full sync in term relationships * changelog Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/13987583222 Upstream-Ref: Automattic/jetpack@8811bda
1 parent 54769ef commit 31e8fd8

File tree

6 files changed

+104
-98
lines changed

6 files changed

+104
-98
lines changed

composer.lock

+32-32
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jetpack_vendor/automattic/jetpack-sync/CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
This is an alpha version! The changes listed here are not final.
1111

12+
### Added
13+
- Sync: Consider blacklisted taxonomies when doing full sync for term relationships
14+
1215
## [4.9.1] - 2025-03-17
1316
### Changed
1417
- Internal updates.

jetpack_vendor/automattic/jetpack-sync/src/modules/class-term-relationships.php

+8-5
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,14 @@ public function get_next_chunk( $config, $status, $chunk_size ) {
178178

179179
return $wpdb->get_results(
180180
$wpdb->prepare(
181-
"SELECT object_id, term_taxonomy_id
182-
FROM $wpdb->term_relationships
183-
WHERE ( object_id = %d AND term_taxonomy_id < %d ) OR ( object_id < %d )
184-
ORDER BY object_id DESC, term_taxonomy_id
185-
DESC LIMIT %d",
181+
"SELECT tr.object_id, tr.term_taxonomy_id
182+
FROM $wpdb->term_relationships tr INNER JOIN $wpdb->term_taxonomy tt
183+
ON tr.term_taxonomy_id=tt.term_taxonomy_id
184+
WHERE " .
185+
Settings::get_whitelisted_taxonomies_sql() // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
186+
. ' AND ( ( tr.object_id = %d AND tr.term_taxonomy_id < %d ) OR ( tr.object_id < %d ) )
187+
ORDER BY tr.object_id DESC, tr.term_taxonomy_id
188+
DESC LIMIT %d',
186189
$status['last_sent']['object_id'],
187190
$status['last_sent']['term_taxonomy_id'],
188191
$status['last_sent']['object_id'],

jetpack_vendor/i18n-map.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
),
7575
'jetpack-sync' => array(
7676
'path' => 'jetpack_vendor/automattic/jetpack-sync',
77-
'ver' => '4.9.2-alpha1742415897',
77+
'ver' => '4.9.2-alpha1742545545',
7878
),
7979
),
8080
);

0 commit comments

Comments
 (0)