Problem/Motivation
In order for #2363341: Throw exception in Drupal::service() and friends, if container not initialized yet. to go in, we have to fix Drush first. This just adds the \Drupal::hasContainer() method, and then once Drush is updated, the other issue can proceed.
Proposed resolution
Add \Drupal::hasContainer() instead of checking if \Drupal::getContainer() === NULL
Remaining tasks
N/A
User interface changes
API changes
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 2421005-hasContainer-1.patch | 1.94 KB | tim.plunkett |
Comments
Comment #1
tim.plunkettComment #2
alexpottLooks like we'll need to get a fix into drush as well so #2404923: Upgrade Drush on qa.d.o is relevant or even #2206501: Remove dependency on Drush from test reviews (I can dream!)
Comment #3
neclimdulPretty straight forward improvement
Comment #4
alexpottThis issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed 2bf5573 and pushed to 8.0.x. Thanks!
Comment #6
cjwest commentedI just rebuilt drush and my site. Upon executing
drush en
I'm receiving:
Fatal error: Call to undefined method Drupal::hashContainer() in .composer/vendor/drush/drush/lib/Drush/Boot/bootstrap.inc on line 824
Drush command terminated abnormally due to an unrecoverable error.
Comment #7
tim.plunkettI hope that's a typo
hashContainershould be
hasContainerComment #8
joelpittet@cjwest maybe there was a bug in drush, can you upgrade to the latest master branch?
Comment #9
berdirThe problem can't be resolved by updating drush, it exists *because* drush was updated and now requires a Drupal Core that has change included. Fairly sure that hashContainer() is just a typo here.
You need to either update core or apply the patch here to your current version, which is fairly easy. I had to do the same.
Comment #10
joelpittetAhhh chickens and eggs.
Comment #11
medienverbinder commentedFresh installation drupal 8.0.0-beta6
Drush did not work. (example: drush st)
I got the following error
With the patch everything works fine!
Many thanks to tim.plunkett.
Comment #12
flashwebcenterThank you very much tim.plunkett for the patch.
Comment #13
geerlingguy commentedThough I know this is in master, it's the only patch required to get drush head to work installing Drupal 8.0.x-beta6 with
drush si.