- Merge request !6098DI in permission callbacks for TaxonomyPermissions → (Closed) created by hardik_patel_12
- 🇮🇳India hardik_patel_12 India
Updated the DI in permission callbacks for TaxonomyPermissions.php, a change record is still needed.
- 🇬🇧United Kingdom joachim
> This will also need a change record. Thanks!
I don't think this needs a CR - the class is internal. It's not even a service.
- 🇵🇪Peru krystalcode
Removing unused Drupal\Core\StringTranslation\TranslationInterface and unused $this->stringTranslation service injection it is not used in file.
The string translation service is used many times in this file, every time
$this->t()
is called. TheStringTranslationTrait
takes care of it if it is missing, but it's hacky and renders the class more difficult to test. It is there for cases where dependency injection is not available or for developer that do not know how to do it, but it should be injected when possible: https://git.drupalcode.org/project/drupal/-/blob/11.x/core/lib/Drupal/Co... - First commit to issue fork.
- 🇦🇺Australia acbramley
Rebased, updated to use autowiring and constructor property promotion, changed to not inject entity storage, added CR and deprecation message although I somewhat agree this is overkill.
- 🇺🇸United States smustgrave
Opened 🌱 META: Use dependency injections in permission callbacks Active to track others
Change here though seems pretty straightforward though, good deprecation.
LGTM
- 🇳🇿New Zealand quietone
Setting to needs work for an item in the MR. Also, this needs a title update.
I see that xjm asked for a Meta to make these changes in other permission callback but I wonder if these can all be done at once. Not sure.
- First commit to issue fork.
- 🇺🇸United States smustgrave
Title seems good now, change still looks good.
- 🇬🇧United Kingdom catch
Committed/pushed to 11.x, thanks!
I jumped the gun and deleted the CR because we don't need change records for constructor bc, then realised that we do need them because phpcs demands one for all depecation messages. I really think we need to change that requirement, but for now I made a new CR and a redirect from the old one to the new one.
- Status changed to Fixed
26 days ago 11:44am 5 June 2025 Automatically closed - issue fixed for 2 weeks with no activity.