[#281] Fixed 'parseUserId()' to handle Drush 12+ table output format.#324
[#281] Fixed 'parseUserId()' to handle Drush 12+ table output format.#324AlexSkrypnyk merged 1 commit intomasterfrom
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughEnhanced Changes
Possibly related issues
Poem
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes ✨ 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 |
Closes #281
Summary
parseUserId()inDrushDriverto handle the table output format introduced in Drush 12+, where user info is returned as a formatted table rather than key-value pairs."User ID : 123"key-value format used by older Drush versions.Problem
DrushDriver::parseUserId()used a regex that only matched the legacy"User ID : 123"key-value format. Drush 12+ changed the output ofuser:informationto a bordered table:This caused
parseUserId()to returnnullfor all users when running Drush 12+, breaking user-related operations.Solution
The updated method tries the legacy regex first (no behaviour change for older Drush). If that does not match but the output contains a
User IDheader, it walks the lines and extracts the first numeric value from the first data row (the UID column).Test plan
"User ID : 123") still parses correctly.1(single digit) parses correctly from table format.nullwithout error.Summary by CodeRabbit
Bug Fixes
Tests