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

Don\'t add profile dependencies to required_by array of modules #2697

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions commands/core/drupal/environment.inc
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,20 @@ use Drupal\Core\Logger\RfcLogLevel;
*/
function drush_get_modules($include_hidden = TRUE) {
$modules = system_rebuild_module_data();
if (\Drupal::hasService('profile_handler')) {
// #1356276 adds the profile_handler service but it hasn't been committed
// to core yet so we need to check if it exists.
$profiles = \Drupal::service('profile_handler')->getProfiles();
}
else {
$profiles[drupal_get_profile()] = [];
}

foreach ($modules as $key => $module) {
// Profiles don't count as real dependents.
if (!empty($module->required_by)) {
$module->required_by = array_diff_key($module->required_by, $profiles);
}
if ((!$include_hidden) && (!empty($module->info['hidden']))) {
unset($modules[$key]);
}
Expand Down