Repository navigation
[#875] Removed flat message selector keys. - #878
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (10)
💤 Files with no reviewable changes (4)
📝 WalkthroughWalkthroughRemoves the deprecated flat message selector keys ( ChangesLegacy flat message selector key removal
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
|
Documentation validation Per-context details |
|
Code coverage (threshold: 70%) Per-class coverage |
Closes #875
Summary
Removes the four flat message-selector keys (
message_selector,error_message_selector,success_message_selector,warning_message_selector) that were deprecated in 6.0.0 underDrupal\DrupalExtension.selectors:. The nestedselectors.messages:map - keyed bydefault,error,success, andwarning- is now the single source of truth.MessageContext::getSelector()throws a descriptiveRuntimeExceptionnaming the exact nested path to configure when a selector is absent.Changes
src/Drupal/DrupalExtension/Context/MessageContext.phpDeprecationInterfaceandDeprecationTraitfromMessageContext; the class no longer implements the deprecation interface.$legacy_key_maplookup, the fallback togetDrupalSelector(), and thetriggerDeprecation()call fromgetSelector().getSelector()now throws aRuntimeExceptionwith a message that names the missing nested path (e.g.Drupal\DrupalExtension.selectors.messages.error) when no selector is configured.src/Drupal/DrupalExtension/ServiceContainer/DrupalExtension.phpscalarNodedefinitions (message_selector,error_message_selector,success_message_selector,warning_message_selector) from the config schema, so the extension no longer accepts them.tests/phpunit/src/MessageContextTest.phptestGetSelectorResolvesNestedSelector()with a four-case data provider covering all selector names (default,error,success,warning).testGetSelectorThrowsWhenNotConfigured()with a three-case data provider covering: noselectorsparameter,selectorswithout amessagesmap, and amessagesmap that is missing the requested type.tests/behat/behatCliUseDeprecatedMessageSelectors()step and its#[Given]registration fromBehatCliTrait.php.message.feature(deprecated selectors still resolve; deprecated selectors emit a notice).deprecation_suppression.feature.Documentation
UPGRADING.md: removed the 6.0 deprecation notice; added a 6.1 "Message selector flat keys removed" section with the migration YAML and theRuntimeExceptionbehaviour.docs/configuration.mdanddocs/drivers/blackbox.md: updated all config examples to use the nestedselectors.messages:map including the newwarningkey.STEPS.md: regenerated to remove the reference to the legacy flat keys.Before / After
Summary by CodeRabbit
Documentation
selectors.messagesstructure.Breaking Changes
selectors.messagesmap format. Missing configuration will trigger an error with guidance on required keys.