Drush 10 and 11 support

Created on 8 September 2022, about 2 years ago
Updated 27 March 2024, 8 months ago

Problem/Motivation

Currently Drush 11 does not recognize potx commands.

[warning] potx commands not loaded because its constraint (^9) is incompatible with Drush 11.1.1. Broaden the constraint in modules/contrib/potx/composer.json (see 'extra\drush\services' section) to make the commands loadable.

Steps to reproduce

Update the drush project to 11 and do a drush site-install with verbose output.

Proposed resolution

Add the constraint drush 10 and 11 to composer.json

🐛 Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

🇪🇸Spain eduardo morales alberti Spain, 🇪🇺

Live updates comments and jobs are added and updated live.
  • Needs manual testing

    The change/bugfix cannot be fully demonstrated by automated testing, and thus requires manual testing in a variety of environments.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇳🇱Netherlands Lendude Amsterdam

    Installed potx on clean D10 install with 📌 Drupal 10 compatibility fixes for potx Fixed applied.

    Enabled potx

    Installed Drush 11.5.1

    Ran:
    drush potx single --folder="modules/contrib/potx/"

    Errors seem to be all errors in the way translations are added in potx

    Errors
     [error]  The first parameter to dt() should be a literal string. There should be no variables, concatenation, constants or other non-literal strings there. At <em class="placeholder">dt(&quot;Processing $file...&quot;)</em> in <em class="placeholder">modules/contrib/potx/potx.drush.inc</em> on line <em class="placeholder">110</em>. Read more at <a href="http://drupal.org/node/322732">http://drupal.org/node/322732</a> 
     [error]  The first parameter to dt() should be a literal string. There should be no variables, concatenation, constants or other non-literal strings there. At <em class="placeholder">dt(&quot;Processing $file...&quot;)</em> in <em class="placeholder">modules/contrib/potx/src/Commands/PotxCommands.php</em> on line <em class="placeholder">104</em>. Read more at <a href="http://drupal.org/node/322732">http://drupal.org/node/322732</a> 
     [error]  The first parameter to error() should be a literal string. There should be no variables, concatenation, constants or other non-literal strings there. At <em class="placeholder">error($error)</em> in <em class="placeholder">modules/contrib/potx/src/Commands/PotxCommands.php</em> on line <em class="placeholder">131</em>. Read more at <a href="http://drupal.org/node/322732">http://drupal.org/node/322732</a> 
    

    Added the output file to the issue, looks good to me.

    The D10 compatibility patch makes some changes to the commands, so not sure if this should be committed before that lands, might be better to wait for that to land

  • Status changed to Needs work 8 months ago
  • 🇳🇱Netherlands spadxiii

    I think there should be a code-change as well, as drush 11 deprecated the drush.services.yml (drush 12 doesn't support it anymore): https://www.drush.org/11.x/dependency-injection/#services-files

    Also, there is a new requirement that the drush commands should be in a 'Drush' subfolder, see the commands.md:

    1. Drush 12 expects commandfiles to use a [create() method](dependency-injection.md#create-method) to inject Drupal and Drush dependencies. Prior versions used a [drush.services.yml file](https://www.drush.org/11.x/dependency-injection/#services-files) which is now deprecated and will be removed in Drush 13.
    1. Drush 12 expects all commandfiles in the `/Drush/` directory. The `Drush` subdirectory is a new requirement.

Production build 0.71.5 2024