Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The Drush 9 command service defined in token is using the id "devel.command", and therefore overwrites the actual devel commands if they're both installed. Let's just rename it to token.command.
Comment | File | Size | Author |
---|---|---|---|
#9 | beforePatch.png | 42.89 KB | paulocs |
#9 | afterPatch.png | 33.08 KB | paulocs |
#6 | search-for-command-name-convention.png | 135.2 KB | merlin06 |
#6 | search-for-service-name.png | 92.15 KB | merlin06 |
#2 | 3145527-2.remove-drush-command-conflict.patch | 288 bytes | jonathan1055 |
Comments
Comment #2
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedOr better still, rename it
token.commands:
as it appears to be convention for commandS to be plural which also matches with the drush9 example module and other contrib drush.services.yml files.Comment #3
nikitagupta CreditAttribution: nikitagupta at Srijan | A Material+ Company for Drupal India Association commentedComment #4
nikitagupta CreditAttribution: nikitagupta at Srijan | A Material+ Company for Drupal India Association commentedpatch #2 applied successfully and working fine. +RTBC
Comment #5
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commented@richard.thomas what did you use to see the namespace clash? I do not get any drush token commands listed.
drush token:
gives "There are no commands defined in the "token" namespace."And to confuse things slightly, there is a devel command whihc lists the tokens
devel:token List available tokens.
This will remain in the devel namespace.@nikitagupta, As there is no automated test coverage for the drush commands, this needs to be checked manually. Can you verify that without the patch and with Devel installed, you get the clash of namespace, and then with the patch applied you do not get the clash?
Comment #6
merlin06 CreditAttribution: merlin06 at Australian Competition and Consumer Commission (ACCC) commented@jonathon1055, The two png files show what I did to find the issue. After my search I had to assume token's drush.services.yml started as a bad copy&paste of devel's drush.services.yml. Service names in the codebase should never clash.
Comment #7
RoSk0Thanks for the patch!
Looks good to me.
Comment #8
jonathan_hunt CreditAttribution: jonathan_hunt at Catalyst IT commented@merlin06 thanks for the patch. I can confirm that after applying the patch, drush devel:* commands are now available.
Comment #9
paulocsAssuming that devel module and token module have the save service id, patch #2 makes sense.
RTBC +1
Comment #10
Renrhaf+1 Tested and reviewed, works fine
Comment #11
BerdirOops, fixed. Thanks.