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)

Files: 
CommentFileSizeAuthor
#14 config-replace_drupal_container-2003576-14.patch1.55 KBJeroenT
PASSED: [[SimpleTest]]: [MySQL] 56,049 pass(es).
[ View ]
#12 config-replace_drupal_container-2003576-12.patch1.55 KBJeroenT
PASSED: [[SimpleTest]]: [MySQL] 55,463 pass(es).
[ View ]
#9 config-replace_drupal_container-2003576-9.patch1.55 KBJeroenT
FAILED: [[SimpleTest]]: [MySQL] 57,333 pass(es), 1 fail(s), and 0 exception(s).
[ View ]
#5 replace-drupal_container-2003576-5.patch1.55 KBalexander.ilivanov
FAILED: [[SimpleTest]]: [MySQL] 55,619 pass(es), 14 fail(s), and 11 exception(s).
[ View ]
#1 2003576-1.patch1.55 KBebeyrent
FAILED: [[SimpleTest]]: [MySQL] Repository checkout: failed to checkout from [git://git.drupal.org/project/drupal.git].
[ View ]

Comments

Status:Active» Needs review
StatusFileSize
new1.55 KB
FAILED: [[SimpleTest]]: [MySQL] Repository checkout: failed to checkout from [git://git.drupal.org/project/drupal.git].
[ View ]

Component:comment.module» config.module

+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverride.phpundefined
@@ -110,7 +110,7 @@ function testConfigLocaleUserOverride() {
+    $config_factory = \Drupal::service('config.factory');

This could be just $this->container->get('config.factory')

Status:Needs review» Needs work

The last submitted patch, 2003576-1.patch, failed testing.

Assigned:ebeyrent» alexander.ilivanov
Status:Needs work» Needs review
Issue tags:+CodeSprintUA
StatusFileSize
new1.55 KB
FAILED: [[SimpleTest]]: [MySQL] 55,619 pass(es), 14 fail(s), and 11 exception(s).
[ View ]

drupal_container() replaced
Patch attached.

Status:Needs review» Reviewed & tested by the community

Looks good.

Status:Reviewed & tested by the community» Needs work

The last submitted patch, replace-drupal_container-2003576-5.patch, failed testing.

+++ b/core/modules/config/config.admin.incundefined
@@ -113,8 +113,8 @@ function config_admin_sync_form(array &$form, array &$form_state, StorageInterfa
+  $target_storage = Drupal::service('config.storage.staging');

This should use the $source_storage.

Status:Needs work» Needs review
StatusFileSize
new1.55 KB
FAILED: [[SimpleTest]]: [MySQL] 57,333 pass(es), 1 fail(s), and 0 exception(s).
[ View ]

replaced drupal_container with Drupal::service.

Status:Needs review» Needs work

The last submitted patch, config-replace_drupal_container-2003576-9.patch, failed testing.

--- a/core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverride.php
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverride.php
@@ -110,7 +110,7 @@ function testConfigLocaleUserOverride() {
       'preferred_langcode' => 'de',
     ));
-    $config_factory = drupal_container()->get('config.factory');
+    $config_factory = Drupal::service('config.factory');

Please use \Drupal::service('config.factory'); in clases.

Status:Needs work» Needs review
StatusFileSize
new1.55 KB
PASSED: [[SimpleTest]]: [MySQL] 55,463 pass(es).
[ View ]

Made changes as suggested by DmitryDrozdik.

+++ b/core/modules/config/config.admin.inc
@@ -113,8 +113,8 @@ function config_admin_sync_form(array &$form, array &$form_state, StorageInterfa
+  $source_storage = \Drupal::service('config.storage.staging');

Need to remove the backslash when in module code.

Should be:

Drupal::service('config.storage.staging');
Drupal::service('config.storage');

Assigned:alexander.ilivanov» Unassigned
StatusFileSize
new1.55 KB
PASSED: [[SimpleTest]]: [MySQL] 56,049 pass(es).
[ View ]

made changes as suggested by ebeyrent.

Status:Needs review» Reviewed & tested by the community

RTBC

Status:Reviewed & tested by the community» Fixed

Committed and pushed to 8.x. Thanks!

Status:Fixed» Closed (fixed)