omega8cc / boa

Barracuda Octopus Aegir 5.4.0
https://omega8.cc/compare
394 stars 75 forks source link

Update of Opigno 3.0.0 in the distro platform #1605

Closed VangelisP closed 1 month ago

VangelisP commented 2 years ago

Hi all.

As D8 has passed the EOL date, i was reviewing if Opigno 3.0.0 (their latest version) can work with D9 on the Aegir stack.

While the platform can be registered properly, site creation fails due to some new code/functionality implemented for drush on the module opigno_statistics, which unfortunately, breaks our drush (8.4.9-dev currently on my instance). It's being written to work with drush9.

I do have a first draft patch that I've tried which seems to resolve the installation issue by stripping out the offending (for drush 8) drush command, however I am aware that this is not he proper approach.

Instead of stripping out the new command that causes a break in drush during installation, is there a way to explicitly define which drush version should run when building a drupal site ? (eg drush8, drush9 etc)

For reference, here is my patch as a code:

diff --git a/opigno_statistics.services.yml b/opigno_statistics.services.yml
index 6593bc8..986e00b 100644
--- a/opigno_statistics.services.yml
+++ b/opigno_statistics.services.yml
@@ -15,8 +15,3 @@ services:
       - [setContainer, ['@service_container']]
     tags:
       - { name: access_check, applies_to: _opigno_access_user_achievements }
-
-  opigno_statistics.update:
-    class: Drupal\opigno_statistics\Commands\StatisticsCommands
-    tags:
-      - { name: drush.command }
diff --git a/src/Commands/StatisticsCommands.php b/src/Commands/StatisticsCommands.php
index 8ff1a29..fc084ef 100644
--- a/src/Commands/StatisticsCommands.php
+++ b/src/Commands/StatisticsCommands.php
@@ -10,6 +10,14 @@ use Drush\Commands\DrushCommands;
  */
 class StatisticsCommands extends DrushCommands {

+  public function getName() {
+    return $this->pluginDefinition['name'];
+  }
+
+  public function getDefinition() {
+    return $this->info;
+  }
+
   /**
    * Makes update of trainings statistics.
    *

Many thanks

omega8cc commented 2 years ago

Aegir can't run any Drush version higher than 8, because its code is based on Drupal 7.x and needs to support also Drupal sites running core 7.x and 6.x, however, the Drush 8 itself is still receiving patches to make it work with Drupal 9+, so it should work, but any offending module should not be enabled on install, but could be enabled while the site is already installed, also with drush10 available on command line (but not for Aegir).

yazzou commented 2 years ago

I have tried what suggested by :