Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
drupal_container() is deprecated, and all calls in the block module need to be replaced with Drupal::service(), except for where the module_handler service is requested, which needs to be replaced with Drupal::moduleHandler() (see #1957154: Replace calls to drupal_container()->get('module_handler') service with Drupal::moduleHandler())
This task a part of #2001206: Replace drupal_container() with Drupal::service()
Comment | File | Size | Author |
---|---|---|---|
#34 | replace-drupal-container-injected-34.patch | 5.35 KB | benjy |
#34 | interdiff.txt | 1.56 KB | benjy |
#30 | replace-drupal-container-injected-30.patch | 5.31 KB | benjy |
#30 | replace-drupal-container-2003058-30.patch | 1.89 KB | benjy |
#30 | interdiff.txt | 5.32 KB | benjy |
Comments
Comment #1
ebeyrent CreditAttribution: ebeyrent commentedComment #2
ebeyrent CreditAttribution: ebeyrent commentedComment #3
ebeyrent CreditAttribution: ebeyrent commentedComment #4
ebeyrent CreditAttribution: ebeyrent commentedComment #6
ddrozdik CreditAttribution: ddrozdik commentedComment #8
ddrozdik CreditAttribution: ddrozdik commentedhm, I will try to find problem and will fix it.
Comment #9
ddrozdik CreditAttribution: ddrozdik commentedComment #11
littleindian CreditAttribution: littleindian commentedHi,
I have submitted patch of respective issue.
Comment #13
littleindian CreditAttribution: littleindian commentedHi,
Please ignore above patch in #11 comment
Check this one.
Comment #15
littleindian CreditAttribution: littleindian commentedApology. I created patch in wrong way.
Now please review.
Comment #16
littleindian CreditAttribution: littleindian commentedNeed review.
Comment #18
ddrozdik CreditAttribution: ddrozdik commented@ashwinikumar, please use Drupal::request(); instead Drupal::service()->get('request');
Comment #19
littleindian CreditAttribution: littleindian commentedUpdated. Need review
Comment #21
littleindian CreditAttribution: littleindian commented@DmitryDrozdik I used Drupal::request(); instead Drupal::service()->get('request');
It's only at one place in block module But still test got failed.
Not sure where my patch is lacking.
Need direction.
Comment #22
ddrozdik CreditAttribution: ddrozdik commentedThis is incorrect way to use, please use Drupal::service('path.alias_manager') for example above, and for all other places.
Comment #22.0
ddrozdik CreditAttribution: ddrozdik commentedUpdated issue summary.
Comment #23
ddrozdik CreditAttribution: ddrozdik commentedComment #25
ddrozdik CreditAttribution: ddrozdik commented#23: 2003058-replace-drupal_container-block-module_23.patch queued for re-testing.
Comment #26
alvar0hurtad0It applyes OK
Comment #27
BerdirThat doesn't mean it's fixed. It needs to get RTBC'd and committed first.
Comment #28
alvar0hurtad0Ok, I'm sorry.
I take note for next times.
Than you very much.
Comment #29
benjy CreditAttribution: benjy commentedWe shouldn't be using \Drupal::service() in OO code, it needs injecting.
Comment #30
benjy CreditAttribution: benjy commentedRe-roll and a new version with dependencies injected. We're also updating module_exists here, not sure we should be doing it in this patch but I added it anyway.
Comment #31
benjy CreditAttribution: benjy commented#30: replace-drupal-container-injected-30.patch queued for re-testing.
Comment #32
chx CreditAttribution: chx commentedAssigning for review.
Comment #33
tim.plunkettMissing a space
Unicode::strtolower
Comment #34
benjy CreditAttribution: benjy commentedBoth issues in #33 fixed. Should drupal_strtolower() be marked as deprecated if we're not using it anymore?
Comment #35
tim.plunkettI guess it should.
Comment #36
alexpottCommitted 58d8e35 and pushed to 8.x. Thanks!
Comment #37.0
(not verified) CreditAttribution: commentedupdate description