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

When backdrop boot classes are present drush does not work on drupal 7 sites. #9

Closed
serundeputy opened this issue Jan 1, 2016 · 10 comments

Comments

@serundeputy
Copy link
Member

This is the error trying to use drush on a drupal 7 site when the backdrop-drush repo is present in ~/.drush folder.

geoff@gspmbp vanilla $ drush st;
PHP Fatal error:  Class 'Drush\Boot\BaseBoot' not found in /Users/geoff/.drush/backdrop/backdrop-drush-master/BackdropBoot.php on line 5

Fatal error: Class 'Drush\Boot\BaseBoot' not found in /Users/geoff/.drush/backdrop/backdrop-drush-master/BackdropBoot.php on line 5
Drush command terminated abnormally due to an unrecoverable error.                                                                                 [error]
Error: Class 'Drush\Boot\BaseBoot' not found in /Users/geoff/.drush/backdrop/backdrop-drush-master/BackdropBoot.php, line 5

Maybe we can fix this so we can use one drush for drupal and backdrop?

@serundeputy
Copy link
Member Author

One way around this if you need to use drush on drupal and backdrop sites is to download a second copy of drush from github.com/drush-ops/drush and put the contents of this repo inside the commands folder of the new drush instance.

For example:

  • cd ~
    • change to your home directory
  • git clone git@github.com:drush-ops/drush.git my_drush
    • you should change my_drush to what you would like to call your new backdrop-drush command.
    • this will clone drush latest master into a directory called my_drush
  • cd my_drush/commands
    • change directories into the new my_drush/commands folder
  • git clone git@github.com:quicksketch/backdrop-drush.git
    • clone this repo into the commands directory of your new drush installation.
  • echo 'alias my_drush="~/my_drush/drush"' >> ~/.bash_profile
  • source ~/.bash_profile

You will now have access to the command my_drush which will work with backdrop installations without breaking your Drupal drush support.

we could put this in the README.md as a section for people using Backdrop and Drupal with drush?

@quicksketch
Copy link
Member

I can reproduce this issue. I have Backdrop's Drush integration in ~/.drush/extensions/backdrop. Drush is installed elsewhere (in ~/Scripts/drush8/). But Drush works fine both with Drupal 7 and Backdrop.

One way around this if you need to use drush on drupal and backdrop sites is to download a second copy of drush from github.com/drush-ops/drush and put the contents of this repo inside the commands folder of the new drush instance.

Yeah this is actually what I started out doing. But the problem for many Drush users may be that Drush is now delivered as a .phar file, so it's not possible to navigate as a normal directory. This approach only works if you clone the Git repo from Drush, which I don't think will be the most common installation approach.

@quicksketch
Copy link
Member

Could you try updating your Drush to the latest 8.0.x branch and see if this still happens?

@serundeputy
Copy link
Member Author

  • I moved Backdrop's Drush extension to : ~/.drush/extensions/backdrop
  • checkout the 8.0.x branch of drush
  • did a pull: git pull origin 8.0.x
  • did : composer update

Drush does not work with my Drupal 7 sites with this setup, but then I moved the Backdrop Drush extension out of the drush install, and drush 8.0.x does not work with my drupal 7 sites either.

If I checkout drush 6.x that works with my drupal 7 sites, but not with the Backdrop extension in the ~/.drush/extensions folder.

So, it seems any way I slice it I need at least two installations of drush. Is your drush 8.0.x working with your D7 sites?

@quicksketch
Copy link
Member

Actually now that I've tried it, I'm getting a mix of non-working results as well. I believe I must have had two versions of Drush active when I was testing (I have aliases for drush6, drush7, and drush8). I'll continue looking into this and see what we can do to prevent Backdrop's extension from botching drush on D7.

@jenlampton
Copy link
Member

I'm running with four versions of drush (don't ask) all aliased.

With the drush commands in ~/.drush/commands drush 8 works on backdrop, both drush 8 and drush 7 do not work on Drupal 7. When I move the commands into my drush 8 instance, drush 7 starts working again. At least that's something :)

@serundeputy
Copy link
Member Author

vid using drush with Backdrop CMS and Drupal
http://serundrop.staffordtavern.com/using-drush-backdrop-cms

@jenlampton
Copy link
Member

I am running the latest version of Drush-master (which, btw, is working with Drupal 7 without the Backdrop commands). When I do a drush cc drush from within Backdrop, I get the following error, the same as I see on Drupal 7 sites:

Fatal error: Call to undefined function drush_get_bootstrap_object() in ~/drush-8/commands/backdrop/backdrop.drush.inc on line 28
Drush command terminated abnormally due to an unrecoverable error.                                                                                                          [error]
Error: Call to undefined function drush_get_bootstrap_object() in ~/drush-8/commands/backdrop/backdrop.drush.inc, line 28

@jenlampton
Copy link
Member

I grepped through the codebase and couldn't find that function anywhere in drush. Perhaps it has been removed in the latest -master? See #24 for more on that.

@jenlampton jenlampton changed the title When backdrop boot classes are present in .drush drush does not work on drupal 7 sites. When backdrop boot classes are present drush does not work on drupal 7 sites. Mar 14, 2016
@jenlampton
Copy link
Member

Now that I am using the correct branch for drush (the 8.x branch) Drush 8 works on Drupal 7 even when the Backdrop commands are present. Anyone else suffering this fate, please check your drush version and branch.

I'm going to close this issue for now, but please re-open if the problem reappears.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants