Skip to content

Instantly share code, notes, and snippets.

@jenlampton
Created September 4, 2015 02:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jenlampton/72338350eab459b04719 to your computer and use it in GitHub Desktop.
Save jenlampton/72338350eab459b04719 to your computer and use it in GitHub Desktop.
possible fix for drush_drupal_version
diff --git a/includes/drupal.inc b/includes/drupal.inc
index b24dc52..f34fee2 100644
--- a/includes/drupal.inc
+++ b/includes/drupal.inc
@@ -47,15 +47,23 @@ function drush_drupal_version($drupal_root = NULL) {
}
}
else {
- // D7 stores VERSION in bootstrap.inc.
- // D6 and below does it in system.module.
- $version_constant_paths = array('/includes/bootstrap.inc', '/modules/system/system.module');
- foreach ($version_constant_paths as $path) {
- if (file_exists($drupal_root . $path)) {
- require_once $drupal_root . $path;
- if (defined('VERSION')) {
- $version = VERSION;
- break;
+ if (file_exists($drupal_root . '/core/misc/backdrop.js')) {
+ require_once $drupal_root . '/core/includes/bootstrap.inc';
+ if (defined('Drupal::VERSION')) {
+ $version = Drupal::VERSION;
+ }
+ }
+ else {
+ // D7 stores VERSION in bootstrap.inc.
+ // D6 and below does it in system.module.
+ $version_constant_paths = array('/includes/bootstrap.inc', '/modules/system/system.module');
+ foreach ($version_constant_paths as $path) {
+ if (file_exists($drupal_root . $path)) {
+ require_once $drupal_root . $path;
+ if (defined('VERSION')) {
+ $version = VERSION;
+ break;
+ }
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment