Comes from #1364814: Extend pm-enable to offer downloading the project for missing extensions

# drush en devel
devel was not found.                                                                                                                                                                                    [warning]
The following projects provide some or all of the extensions not found:                                                                                                                                 [ok]
devel
Would you like to download them? (y/n): y
Project devel (8.x-1.x-dev) downloaded to /var/www/drupal-8.x-dev/sites/default/modules/devel.                                                                                                          [success]
Project devel contains 3 modules: devel_generate, devel_node_access, devel.
devel was not found.                                                                                                                                                                                    [warning]
The following projects provide some or all of the extensions not found:                                                                                                                                 [ok]
devel
Would you like to download them? (y/n): 

It seems the module cache doesn't refresh.

Comments

iamEAP’s picture

Betting this is because, in Drupal 7, system_rebuild_module_cache() implements a drupal static cache so that it's only run once per request.

iamEAP’s picture

Actually, I cannot reproduce this in Drupal 7; can only reproduce in Drupal 8.

iamEAP’s picture

Status: Active » Needs review
StatusFileSize
new6.04 KB

How about something like this?

Adding a $force_rebuild parameter to drush_get_extensions() and all corresponding drush_get_[modules|themes] implementations / passing it through.

Note that Drupal 6 doesn't statically cache its module/theme get/rebuild functions, so the flag is actually meaningless there.

jonhattan’s picture

Status: Needs review » Active

It is reproducible in D8 but the underlying problem is that drush relies on the behaviour of system_rebuild_module_data() and system_rebuild_theme_data() in D7, that clear each other's collected data. So this data is rebuild twice.

I'm in a travel, and probably won't work on this and other issues until next week.

moshe weitzman’s picture

Priority: Normal » Major

Would be good to clear this up before Drush6 release.

moshe weitzman’s picture

Status: Active » Closed (duplicate)