-1

I just install a Drupal 9.2 site and Drush 10 to manage it. Usually I use Drush 9 and Drupal 8.9.

It appear option for pml command seem not to work in Drush 10 as it do in Drush 9. Example:

 drush @pfdevd9pf pml --filter=rss
  The "--filter" option does not exist.

drush @pfdevd9pf pml | grep "rss"
 RRSSB  Ridiculously Responsive Social Share Buttons (rrssb)   Disabled   8.x-2.3

This is a weird thing, then I do a module activation:

 drush @pfdevd9pf en -y rrssb
 [success] Successfully enabled: rrssb

But pml still give the same info about module version:

  RRSSB   Ridiculously Responsive Social Share Buttons (rrssb)   Enabled    8.x-2.3

I use D8 website too on this server, but installations are distincts. If someone know about this, and why pml doesn't use the option ?

Thanks

EDIt: about the version number for module, as @4k4 say, it depends on the module developpment. This is another example for D9:

  Other    Backup and Migrate (backup_migrate) Disabled   5.0.1

EDIt2: multiple drush version can be an issue, because in my .bash_profile I get: Drush 8 globally installed

alias drush='$HOME/bin/composer/composer.phar/vendor/drush/drush/drush'

then:

#Création d'un alias pour Drush 9 pour usage global
alias drush9='$HOME/www/pfdev/multid8/vendor/drush/drush/drush'

#Création d'un alias pour Drush 10 pour usage global
alias drush10='$HOME/www/pfdev/multid9/recommended-project/vendor/drush/drush/drush'

#PATH ajouté manuellement suite retour commande Drush
#export PATH="$PATH:$HOME/www/pfdev/multid8/vendor/drush/drush/drush"

    # Switch drush versions for session. Changer de version pour la session
    alias d8='export PATH=$HOME/bin/drush:$PATH'
    alias d9='export PATH=$HOME/www/pfdev/multid8/vendor/bin:$PATH'
    alias d10='export PATH=$HOME/www/pfdev/multid9/recommended-project/vendor/bin:$PATH'

but I use drush as alias, never d9 or d10.In addition, I need to be on the ~/ to use alias...created for D8. So I think I need to change my Drush 8 install, and remove it globally. isn't it ?

7
  • 1
    The filter option does work in Drush 10, just tested it. But this doesn't really matter because you can just use grep as you've demonstrated. But how is this connected with the other things you are doing?
    – 4k4
    Nov 3 '21 at 11:08
  • 1
    But pml still give the same info about module version: That's the expected result, enabling a module does not alter its version.
    – Clive
    Nov 3 '21 at 11:28
  • @4k4 Are you sure? Output from drush pml --help doesn't show a filter option and I get the same error message using Drush 10.6.1 (The "--filter" option does not exist.)
    – Clive
    Nov 3 '21 at 11:31
  • @4k4 is it normal that the module version 8.x is the same for D8 or D9 website ? Nov 3 '21 at 11:36
  • 1
    Yes, modules now can support two Drupal versions at the same time. The semantic versioning has changed and doesn't contain the core version anymore. Most modules move for example from 8.x-2.3 to 3.0.x when publishing a new release. But they don't need to, they can still use the old version in Drupal 9.
    – 4k4
    Nov 3 '21 at 11:54
2

But my question is about the filter option, by the way

The filter option is available in the current Drush version. In general https://www.drush.org/latest/output-formats-filters/#output-filters and for this drush command https://www.drush.org/latest/commands/pm_list/.

If not, then you are probably running an older Drush version installed somewhere on your computer. To be sure run Drush locally from the root folder of your Drupal site:

composer require drush/drush
vendor/bin/drush pml --filter=block

This should display the two core modules and one or two others.

3
  • I think the issue come from the .bash_profile. See my edit about that. Nov 3 '21 at 15:49
  • 2
    Yes, probably. Best practice is to run drush like in my answer. If you don't want to specify vendor/bin/drush each time see github.com/drush-ops/drush-launcher
    – 4k4
    Nov 3 '21 at 16:09
  • Once I done the migration of my last D6 website, I will use only Drush9 and 10 project based. And issues could be fixed. Thanks for your help. Nov 3 '21 at 16:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.