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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

micahw156’s picture

Assigned: Unassigned » micahw156

I'm willing to take a stab at fixing this, but I might not be able to get to it until later in the week.

moshe weitzman’s picture

Ping - any news?

micahw156’s picture

Sorry, 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.

micahw156’s picture

Status: Active » Needs work
FileSize
842 bytes

The 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:

$ drush dl drupal-8.x-dev
Project drupal (8.x-dev) downloaded to /tmp/drupal-8.x-dev.                                                              [success]
Project drupal contains:                                                                                                 [success]
 - 75 themes: standard.info, drupal_system_listing_incompatible_test.info, drupal_system_listing_compatible_test.info,

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.

moshe weitzman’s picture

Assigned: micahw156 » jonhattan
Priority: Minor » Normal

Would be great if jonhattan could review this.

jonhattan’s picture

I'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 of drupal_scan_directory(). Probably any extra code to handle info.yml case must be in place.

jonhattan’s picture

FileSize
2.28 KB

committing 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.

jonhattan’s picture

Status: Needs work » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.