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 user 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)
Comments
Comment #1
ebeyrent CreditAttribution: ebeyrent commentedFirst patch attempt
Comment #2
ebeyrent CreditAttribution: ebeyrent commentedComment #4
ebeyrent CreditAttribution: ebeyrent commented#1: 2001044-1.patch queued for re-testing.
Comment #6
ebeyrent CreditAttribution: ebeyrent commentedComment #8
alexander.ilivanov CreditAttribution: alexander.ilivanov commentedWill be done today during Code Sprint UA
Comment #9
alexander.ilivanov CreditAttribution: alexander.ilivanov commenteddrupal_container() replaced
Patch attached.
Comment #10
alexander.ilivanov CreditAttribution: alexander.ilivanov commentedComment #11
Berdir\ is not necessary if it's not in a class, same for other cases.
Instead of Drupal::service('flood'), you can use Drupal::flood()
Comment #12
alexander.ilivanov CreditAttribution: alexander.ilivanov commentedYou are right.
Comment #13
andypostEach test have own container so use it
use $this->container->get('needed service')->operation
Comment #14
alexander.ilivanov CreditAttribution: alexander.ilivanov commentedFixed for Test
Patch added.
Comment #15
andypostPLease do not change this
Comment #17
alexander.ilivanov CreditAttribution: alexander.ilivanov commentedfixed.
Comment #18
andypostLet's see what bot say
Comment #19
ddrozdik CreditAttribution: ddrozdik commentedComment #20
andypostAwesome
Comment #21
andypostThis 2 hunks was lost
Comment #22
jlbellidoAdded fixes for Drupal::service('flood'); lost in #19
Comment #24
jlbellido#22: 2001044-replace-drupal_container-user-module_22.patch queued for re-testing.
Comment #25
unstatu CreditAttribution: unstatu commented#22: 2001044-replace-drupal_container-user-module_22.patch queued for re-testing.
Comment #27
jlbellidoNeeds reroll
Comment #28
aitiba CreditAttribution: aitiba commentedI re-roll the patch using the re-roll guidelines and with @jlbellido's teach. I remove user_login_authenticate_validate() and user_login_final_validate() functions of user.module because these functions no longer exist and are deleted before the last patch was uploaded.
Thanks to @jlbellido for teach me how goes the re-rolling and @alexpott for guide me.
Comment #30
alexpottHey @aitiba... this is part of the conflict information. Before you upload patches it's great to manually test them first. You can do this by enabling the simpletest module and running the user tests. And a manual inspection of the patch file before uploading can reveal this. Basically you should be able to review the patch file and think yep that all makes sense.
As I did the re-roll yesterday to help on irc I will upload my version so you can contrast and compare the patches... and perhaps try the reroll process again to see if you can come up with the same patch.
Also we can now inject the user.data service properly into the views UserData plugin and not just pull it from the Drupal static. The code that does this is...
Comment #31
alvar0hurtad0Needs reroll
Comment #32
ebeyrent CreditAttribution: ebeyrent commentedLooks good to me. RTBC
Comment #33
longwaveThis method does nothing except call its parent now, so can't it just be removed?
Comment #34
ayelet_Cr CreditAttribution: ayelet_Cr commentedComment #36
ayelet_Cr CreditAttribution: ayelet_Cr commented#34: 2001044-replace-drupal_container-user.patch queued for re-testing.
Comment #37
Crell CreditAttribution: Crell commentedThanks!
Comment #38
webchickCommitted and pushed to 8.x. Thanks!