diff --git a/includes/environment.inc b/includes/environment.inc index c77f5d8b26..b8847f66c5 100644 --- a/includes/environment.inc +++ b/includes/environment.inc @@ -353,11 +353,13 @@ function drush_locate_root($start_path = NULL) { */ function drush_valid_drupal_root($path) { if (!empty($path) && is_dir($path) && file_exists($path . '/index.php')) { - // Drupal 8 root. Additional check for the presence of core/composer.json to + // Drupal 8 root. Additional check for the presence of core/core.services.yml // grant it is not a Drupal 7 site with a base folder named "core". $candidate = 'core/includes/common.inc'; - if (file_exists($path . '/' . $candidate) && file_exists($path . '/core/misc/drupal.js') && file_exists($path . '/core/core.services.yml')) { - return $candidate; + if (file_exists($path . '/' . $candidate) && file_exists($path . '/core/core.services.yml')) { + if (file_exists($path . '/core/misc/drupal.js') || file_exists($path . '/core/assets/js/drupal.js')) { + return $candidate; + } } // Drupal 7 root. $candidate = 'includes/common.inc';