Problem/Motivation
When #86287: Password reset process ignores the user's language preference is committed there will be no places in core that provide a langcode argument to _user_mail_notify(). Therefore we should consider deprecating this argument.
Remaining tasks
User interface changes
None.
API changes
Deprecate langcode argument in _user_mail_notify().
Data model changes
None.
Release notes snippet
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 3186752-7.patch | 3.19 KB | longwave |
Comments
Comment #2
g-brodieiFollowing for future deprecation work TODO.
Comment #3
ravi.shankar commentedTried to address this issue, please review.
Comment #5
jonathanshawThis is technically an internal API, but I suspect it should have a change record as it's ancient and useful and it's probably not uncommon for it to be called by custom code.
See change record
I think this should be "Specifying the notification language using the $langcode parameter is deprecated in drupal:9.2.0 and is removed from drupal:10.0.0. Omit the parameter. See https://..."
Comment #6
longwaveWe have a test fail presumably due to this:
So we still have one caller that sets $langcode - is this safe to simply remove?
Comment #7
longwaveAdded change record: https://www.drupal.org/node/3187082
Answering my own question in #6: yes, because the fallback is to the preferred langcode anyway.
Addressed #5 and #6 and added a deprecation test.
Comment #8
g-brodiei1. Tried the test and it does push the deprecation message into the deprecation collections.
2. Test will fail when @trigger_error was commented out.
3. The message in deprecation annotation block and @trigger_error are both clear and easy to understand.
4. Confirms the removal of $langcode in _user_mail_notify in UserAuthenticationController.php does fall back to preferred Langcode by default.
Ref:
https://www.drupal.org/about/core/policies/core-change-policies/drupal-c...
Comment #9
alexpottCommitted ab50d1b and pushed to 9.2.x. Thanks!