Metadrop/drupal-updater

Problem to detect obsolete modules in a multisite

Closed this issue · 3 comments

When drupal-updater runs in a different environment than default (e.g. "@es.local) the following error appears:
image

I think the issue might be that the showObsoleteDrupalModules() method doesn't consider the environment.

After applying the next patch, it seems to be working correctly.

diff --git a/src/UpdaterCommand.php b/src/UpdaterCommand.php
index a0c3398..090eaa3 100644
--- a/src/UpdaterCommand.php
+++ b/src/UpdaterCommand.php
@@ -498,9 +498,12 @@ Update includes:
    */
   protected function showObsoleteDrupalModules() {
     $this->printHeader2('Unsupported Drupal modules:');
-    $this->output->writeln(
-      $this->runCommand(sprintf('drush php-script %s/../scripts/unsupported-modules.php', __DIR__)),
-    );
+    foreach ($this->environments as $environment) {
+      $this->output->writeln(sprintf('Running drush %s php-script %s/../scripts/unsupported-modules.php', $environment, __DIR__));
+      $this->output->writeln(
+          $this->runCommand(sprintf('drush %s php-script %s/../scripts/unsupported-modules.php', $environment, __DIR__))
+      );
+    }
   }
 
   /**

image

Thanks for the report and the patch, it looks good but currently I don't the time to test it properly. Let's wait a for a proper review.

Thx for reporting and offering a solution. PRs are accepted.

I want to solve in a way that the output shows only one table , and a extra column that indicates which sites are affected for the obsolete module.

Until that today I will release a version wth a correction based on the snippet provided so the bug is fixed for multisites without default site.

Fixed since 1.6.1, but there is also a 1.6.2 version with improvements.

I've finally applied the definitive solution so now for every unsupported module it specifies which sites are affected. This is done as every site of every multisite may have different modules enabled so the list can vary.

It looks like this:
imagen