drupal_container() is deprecated, and all calls in the aggregator 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

ebeyrent’s picture

StatusFileSize
new2.07 KB
bojanz’s picture

Status: Active » Needs review

Status: Needs review » Needs work

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

ebeyrent’s picture

StatusFileSize
new1.43 KB

Fixed calls to Drupal static methods

ebeyrent’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 2001202-4.patch, failed testing.

ebeyrent’s picture

Status: Needs work » Needs review

#1: 2001202-1.patch queued for re-testing.

ddrozdik’s picture

Assigned: ebeyrent » ddrozdik
Issue tags: +CodeSprintUA
StatusFileSize
new2.74 KB

Replaced all places where was called drupal_container() and also changed module_exists() function.

Status: Needs review » Needs work

The last submitted patch, 2001202-replace-drupal_container-aggregator-module.patch, failed testing.

ddrozdik’s picture

hm, I will try to find problem and will fix it.

ebeyrent’s picture

+++ b/core/modules/aggregator/aggregator.admin.inc
@@ -73,8 +73,8 @@ function aggregator_form_category_validate($form, &$form_state) {
+    Drupal::service('plugin.manager.block')->clearCachedDefinitions();

Should be \Drupal::service()

+++ b/core/modules/aggregator/lib/Drupal/aggregator/FeedStorageController.php
@@ -84,8 +84,8 @@ protected function preSave(EntityInterface $entity) {
+    if (Drupal::moduleHandler()->moduleExists('block')) {

Should be \Drupal::moduleHandler()

ddrozdik’s picture

Status: Needs work » Needs review
StatusFileSize
new3.12 KB
ebeyrent’s picture

Status: Needs review » Reviewed & tested by the community

RTBC

webchick’s picture

Status: Reviewed & tested by the community » Needs work

This no longer applies for me.

ddrozdik’s picture

Status: Needs work » Needs review
StatusFileSize
new2.71 KB
ParisLiakos’s picture

Status: Needs review » Reviewed & tested by the community

thank you

alexpott’s picture

+++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Core/Entity/Feed.phpundefined
@@ -191,7 +191,7 @@ public static function preCreate(EntityStorageControllerInterface $storage_contr
-    if (module_exists('block')) {
+    if (\Drupal::moduleHandler()->moduleExists('block')) {
       \Drupal::service('plugin.manager.block')->clearCachedDefinitions();

I'm tempted to postpone this on making the EntityManager inherit from DefaultPluginManager

ParisLiakos’s picture

we can make it use the property there, we dont even have an issue for that yet...but i am fine with anything

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed cdcba7f and pushed to 8.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.