Score:-1

Options for pml command with Drush 10

us flag

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 ?

4uk4 avatar
cn flag
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?
cn flag
_But pml still give the same info about module version:_ That's the expected result, enabling a module does not alter its version.
cn flag
@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._)
us flag
@4k4 is it normal that the module version 8.x is the same for D8 or D9 website ?
4uk4 avatar
cn flag
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.
4uk4 avatar
cn flag
@Clive, interesting, I have the same `drush version`: Drush version : 10.6.1
us flag
@Clive yes I know that but I was surprised to see the same version number for D8 and D9 modules. As 4k4 say, it is the normal way. But my question is about the filter option, by the way. :)
Score:2
cn flag

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.

us flag
I think the issue come from the .bash_profile. See my edit about that.
4uk4 avatar
cn flag
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 https://github.com/drush-ops/drush-launcher
us flag
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.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.