fix(#3569210): compare target_id numerically so retroactive update works on PostgreSQL - #19
fix(#3569210): compare target_id numerically so retroactive update works on PostgreSQL#19Decipher wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe batch updater now compares ChangesBatch updater query fix
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized database comparison fix is merge-ready after normal checks and review; no actionable merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…rks on PostgreSQL
8c16914 to
f16dc76
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 8.x-1.x #19 +/- ##
===========================================
+ Coverage 81.16% 83.39% +2.23%
===========================================
Files 19 20 +1
Lines 722 783 +61
===========================================
+ Hits 586 653 +67
+ Misses 136 130 -6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Fixes https://www.drupal.org/project/filefield_paths/issues/3569210
Problem
Batch\Updater::batchUpdate()builds the retroactive update entity query with a string comparison on the file reference column:target_idis a bigint. MySQL and SQLite silently coerce the empty string, but PostgreSQL rejects the comparison, so every retroactive update on a PostgreSQL site crashes before the batch is created:Fix
Adopts the one-line numeric comparison from the community fix on drupal.org MR !59 (nickolaj, re-rolled by liam morland):
Semantics are identical on every supported database:
target_idis a file entity ID, always a positive integer when set, and rows with no value are absent from the field table entirely.Verification
Reproduced and verified against a local PostgreSQL 16:
SIMPLETEST_DB="pgsql://..." make test-kernelfails with 7 errors, allSQLSTATE[22P02]raised fromUpdater.phpby the existing kernel tests.BatchUpdaterTest::testReturnsFalseWhenFileFieldIsEmptypins the exclusion semantics of the numeric operator.Notes
Independent of #18, both branch directly off
8.x-1.xto mirror how the drupal.org MRs must be structured. The two touch the same file, so whichever merges second takes a trivial rebase of the same line.🤖 Generated with Claude Code
Summary by CodeRabbit