Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When I download a Drupal 8 module with drush dl, drush reports "Project [name] contains 0 modules: ."
This is cosmetic and doesn't affect functionality, so it's not urgent.
Comment | File | Size | Author |
---|---|---|---|
#7 | drush-1939200.patch | 2.28 KB | jonhattan |
#4 | drush-pm-extensions-yml-1939200-04.patch | 842 bytes | micahw156 |
Comments
Comment #1
micahw156I'm willing to take a stab at fixing this, but I might not be able to get to it until later in the week.
Comment #2
moshe weitzman CreditAttribution: moshe weitzman commentedPing - any news?
Comment #3
micahw156Sorry, I've been sick and haven't touched a computer in almost a week.
I was able to take a few minutes and found the code that needs work in function drush_pm_extensions_in_project() around line 1720 in commands/pm/pm.drush.inc.
I'm running out the door right now, but I may have more time to look at this later tonight. Looks fairly simple to add D8 code without breaking existing reporting for older Drupal versions.
Comment #4
micahw156The attached patch provides a partial solution by modifying two calls to drush_scan_directory() from drush_pm_extensions_in_project() to accommodate for .yml extensions on info files. Since the info files are not actually read by this function, no other changes should be required for detecting and displaying modules, themes and profiles.
However, this patch brings to light a different issue in drush_scan_directory(). The name property returned by this function is expected to be a bare basename. Previous versions would return "modulename" from "modulename.info", but now it is returning "modulename.info" from "modulename.info.yml".
This results in some skewed results:
I don't know if that should be handled as a second issue, or if it should just be addressed locally here. It depends on what else this might affect, and I'm not familiar enough with drush innards to make that guess.
@moshe / maintainers:
Please advise and let me know how I should proceed. If you want, I can further modify drush_pm_extensions_in_project() to be more versatile in handling extension stripping. If you think this is better handled by updating drush_scan_directory() then I would assume that needs to become a separate issue.
Comment #5
moshe weitzman CreditAttribution: moshe weitzman commentedWould be great if jonhattan could review this.
Comment #6
jonhattanI'll review this in detail tomorrow. For now, I think no second issue is neccesary
drush_scan_directory()
should stay as it is, since it is a copy ofdrupal_scan_directory()
. Probably any extra code to handle info.yml case must be in place.Comment #7
jonhattancommitting the patch attached.
Side note: drupal_scan_directory() doesn't exist. It is file_scan_directory(). Drush implements an adaptation of the drupal 6 version. At some point you could update to the drupal 8 version just to keep in sync but it neither fix the problem found here.
Comment #8
jonhattanCommitted.