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

CommentFileSizeAuthor
#4 general.pot5.45 KBlendude

Issue fork potx-3308598

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

gábor hojtsy’s picture

Status: Active » Needs review
Issue tags: +Needs manual testing

Woah, does it work otherwise then? Did you manually test?

lendude’s picture

StatusFileSize
new5.45 KB

Installed potx on clean D10 install with #3285613: Drupal 10 compatibility fixes for potx 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

spadxiii’s picture

Status: Needs review » Needs work

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.