Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drush installation is not detected for other site alias when having multiple local Drupal installations with aliases #5686

Closed
ordermind opened this issue Jul 5, 2023 · 1 comment

Comments

@ordermind
Copy link
Contributor

Describe the bug
I have multiple local Drupal installations with site aliases. When I run a drush command for another site, I get the error message "[preflight] The alias @ references a Drupal site that does not contain its own copy of Drush. Please add Drush to this site to use it."

To Reproduce

  1. Setup two Drupal installations on the same server and install drush on both of them.
  2. Define site aliases for the two installations
  3. cd into the first installation and then run for example drush @<other-site-alias> status
  4. You will now get the message "[preflight] The alias @ references a Drupal site that does not contain its own copy of Drush. Please add Drush to this site to use it."

Expected behavior
The message should not be displayed as Drush is installed on both sites.

Actual behavior
The message is displayed, indicating that Drush needs to be installed on the other site even though it is already installed.

System Configuration

Q A
Drush version? 12.x (latest dev release)
Drupal version? 10.0.9
PHP version 8.1
OS? Linux

Additional information
I dug around in the code and found some weird return types/values which seem to be causing this issue so I created a potential fix that I will include with this issue.

@weitzman
Copy link
Member

weitzman commented Jul 6, 2023

Lets discuss on the PR

@weitzman weitzman closed this as completed Jul 6, 2023
weitzman pushed a commit that referenced this issue Jul 7, 2023
#5687)

* #5686 Fix issue "Drush installation is not detected for other site alias when having multiple local Drupal installations with aliases"

* Change return type to array

* Use phpstan array shapes to define complex return type

* Use constant for exit status

---------

Co-authored-by: Kristofer Tengström <info@kristofer-tengstrom.se>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants