Fix numeric bundle machine name route build failure - #12
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)
📝 WalkthroughWalkthroughThe route builder now converts bundle values to strings before resource type lookup. A kernel test covers numeric node-type machine names and verifies a successful JSON:API Views request. ChangesNumeric Bundle Route Lookup
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 8.x-1.x #12 +/- ##
========================================
Coverage 94.11% 94.11%
========================================
Files 3 3
Lines 136 136
========================================
Hits 128 128
Misses 8 8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Fixes drupal.org/i/3503402. A bundle machine name that's all digits (e.g.
123) breaks route building:array_keys()on the bundle info array turns it into an int, andResourceTypeRepository::get()asserts its$bundleargument is a string. Route rebuild throwsAssertionError: A bundle ID is required.Casts the bundle ID to a string before the lookup, matching Drupal core's fix for the same class of bug (#3075831). Adds Kernel test coverage that creates a numeric-machine-name content type and confirms route rebuild and the JSON:API response both succeed.
Tests green on D10 and D11.
Summary by CodeRabbit
Bug Fixes
Tests