Drush 12 incompatible

Created on 12 August 2023, over 1 year ago
Updated 11 February 2024, 9 months ago

Problem/Motivation

PHP Fatal error: Class Drupal\civicrm_drush\Commands\CivicrmDrushSqlCommands cannot extend final class Drush\Commands\sql\SqlCommands in ../web/modules/contrib/civicrm_drush/src/Commands/CivicrmDrushSqlCommands.php on line 12

SqlCommands class has been changed in drush 12

Steps to reproduce

drush en civicrm_drush

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇮🇹Italy Turneight

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Turneight
  • 🇩🇰Denmark ressa Copenhagen

    It would be great to get Drush 12/Drupal 10 support, since Drupal 9 is EOL Nov. 2023. Here are two possibly relevant issues:

  • 🇮🇹Italy Turneight

    I'm using Drupal 10 with Drush 11 and CiviCRM Drush 8.x-2.0
    The problem is that Drupal 10 defaults to Drush 12
    It is at least necessary to indicate the dependency with Drush 11 in the composer.json file otherwise the installation will not be successful.
    CiviCRM Drush is essential especially for cron because currently cv is not compatible and I have not found any other way to do it.

  • 🇮🇳India sunilpawar Pune

    @Turneight

    i am looking for help on this civicrm sql command.
    Do you have info about this type issue issue. ?

    ---

    i will modify the composer.json for drush version dependency.

  • 🇩🇰Denmark ressa Copenhagen

    Not only does Drupal 10 default to Drush 12, it requires it:

    https://www.drush.org/12.x/install/#drupal-compatibility

    So we probably can't just lower the version to Drush 11, but need to update the CiviCRM Drush code to work with Drupal 12. See my comment above 🐛 Drush 12 incompatible Active for two links to possibly related issues.

  • 🇮🇹Italy Turneight

    Drupal 10 with Drush 11 gave me no problems.
    Drush 11 has EOL in two months, so we should definitely move to Drush 12.
    Drupal 9 also has EOL in two months, so many projects in this period will move to Drupal 10 and will find this unpleasant error.
    Since the proposed patch is simple and quick, even if it doesn't solve the problem, I think it's important to apply as soon as possible, at least it makes it clear how to proceed with the installation.
    In the short term I cannot help you with development, but I am available for testing.
    The links proposed by @ressa seem to me to be a good starting point for understanding how to proceed.

  • 🇩🇪Germany gogowitsch

    Until the actual incompatibility with Drush 12 is fixed, I suggest we quickly release an intermediate version that just prevents civicrm_drush to be installed alongside Drush 12.

    Please review the patch I have attached for composer.json. It is exactly the change from the following commit on the 8.x-2.x branch: https://git.drupalcode.org/issue/civicrm_drush-3380821/-/commit/508cf4b4...

  • 🇮🇳India sunilpawar Pune

    PATCH is applied and released new version with this drush version restriction until we have working drush civicrm sql functionality.

    diff --git a/composer.json b/composer.json
    index 8f57813..85d7c74 100644
    --- a/composer.json
    +++ b/composer.json
    @@ -10,6 +10,7 @@
             "source": "https://github.com/skvare/civicrm_drush"
         },
         "require": {
    -      "civicrm/civicrm-drupal-8": "*"
    +      "civicrm/civicrm-drupal-8": "*",
    +      "drush/drush": "^9||^10||^11"
         }
     }
    
  • 🇮🇹Italy Turneight

    Tested 8.x-3.x versions with Drush 12.
    Everything works fine.
    Thanks for your work.
    For me it can be closed.

  • Status changed to Fixed 10 months ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024