Comments

Thalles created an issue. See original summary.

thalles’s picture

Status: Needs review » Needs work
thalles’s picture

Status: Needs work » Needs review
StatusFileSize
new4.41 KB

Here is the patch that injects dependencies.

Status: Needs review » Needs work
thalles’s picture

Status: Needs work » Needs review
StatusFileSize
new4.39 KB

Status: Needs review » Needs work
thalles’s picture

Status: Needs work » Needs review
StatusFileSize
new3.35 KB

Follow the patch!

berdir’s picture

Status: Needs review » Needs work
+++ b/src/Form/PathautoAdminDelete.php
@@ -56,7 +68,7 @@ class PathautoAdminDelete extends FormBase {
 
     // First we do the "all" case.
-    $storage_helper = \Drupal::service('pathauto.alias_storage_helper');
+    $storage_helper = $this->aliasStorageHelper;
     $total_count = $storage_helper->countAll();
     $form['delete']['all_aliases'] = [

no need to use a local variable anymore then

thalles’s picture

Status: Needs work » Needs review

Follow a new patch!

thalles’s picture

thalles’s picture

#10 with error $$this->aliasStorageHelper

Status: Needs review » Needs work
thalles’s picture

Status: Needs work » Needs review
StatusFileSize
new3.61 KB

Follow the patch!

idebr’s picture

The patch in #14 correctly replaces all possible \Drupal:: calls in \Drupal\pathauto\Form\PathautoAdminDelete

  • Berdir committed 899d546 on 8.x-1.x authored by thalles
    Issue #3011711 by thalles, idebr: Drupal dependency injection on file...
berdir’s picture

Status: Reviewed & tested by the community » Fixed

Thanks.

thalles’s picture

Thanks all!

Status: Fixed » Closed (fixed)

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