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 config 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)
Comment | File | Size | Author |
---|---|---|---|
#14 | config-replace_drupal_container-2003576-14.patch | 1.55 KB | JeroenT |
#12 | config-replace_drupal_container-2003576-12.patch | 1.55 KB | JeroenT |
#9 | config-replace_drupal_container-2003576-9.patch | 1.55 KB | JeroenT |
#5 | replace-drupal_container-2003576-5.patch | 1.55 KB | alexander.ilivanov |
#1 | 2003576-1.patch | 1.55 KB | ebeyrent |
Comments
Comment #1
ebeyrent CreditAttribution: ebeyrent commentedComment #2
ebeyrent CreditAttribution: ebeyrent commentedComment #3
dawehnerThis could be just $this->container->get('config.factory')
Comment #5
alexander.ilivanov CreditAttribution: alexander.ilivanov commenteddrupal_container() replaced
Patch attached.
Comment #6
tstoecklerLooks good.
Comment #8
dawehnerThis should use the $source_storage.
Comment #9
JeroenTreplaced drupal_container with Drupal::service.
Comment #11
ddrozdik CreditAttribution: ddrozdik commentedPlease use \Drupal::service('config.factory'); in clases.
Comment #12
JeroenTMade changes as suggested by DmitryDrozdik.
Comment #13
ebeyrent CreditAttribution: ebeyrent commentedNeed to remove the backslash when in module code.
Should be:
Drupal::service('config.storage.staging');
Drupal::service('config.storage');
Comment #14
JeroenTmade changes as suggested by ebeyrent.
Comment #15
ebeyrent CreditAttribution: ebeyrent commentedRTBC
Comment #16
webchickCommitted and pushed to 8.x. Thanks!
Comment #17
ddrozdik CreditAttribution: ddrozdik commented