When a module is enabled that's part of a bigger project e.g. fieldgroup in the cck project, or when the module has been badly named e.g. google_analytics has a googleanalytics.module file in it, then _drush_generate_makefile() skips over it. This is because of the check at around l50:
foreach ($project_info as $item) {
$name = $item->name;
$type = $item->type;
if ($item->info['project'] != 'drupal' && $item->info['project'] == $name) {
If the project isn't the same as the module name, nothing happens.
Please find attached a patch to fix this behaviour. This patch does as follows:
* Check if the project and module names are different: if so, mark this as a "subproject"
* Set the project name to be the actual project name
* Only get updatexml on full projects
* Only process the first subproject to extract its parent project data
* Only check the file location if this is a full project (it just gets confused for subprojects.)
This issue will also affect #894440: Enhance generate-makefile to include d.o project version numbers eventually, as it does a check based on $name, which should probably change to $project_name .
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 939178-work-with-894440.patch.txt | 1.75 KB | jp.stacey |
| #1 | 939178-drush-generate-makefile-subproject-bug.2.patch.txt | 1.89 KB | jp.stacey |
| drush-generate-makefile-subproject-bug.patch.txt | 1.73 KB | jp.stacey |
Comments
Comment #1
jp.stacey commentedRe-rolling patch - manual edits seemed to break it.
Comment #2
jp.stacey commentedHere's a further experiemental patch to get this working with #894440: Enhance generate-makefile to include d.o project version numbers.
Comment #3
dmitrig01 commentedYeah, that looks a little more along the lines of what I was thinking. What's an example of a module where this is the case?
Comment #4
dmitrig01 commentedHm, this patch doesn't apply anymore. could you look into it?
Comment #5
peter.walter commentedI have this problem when using drush generate-makefile on my site, coincidentally with the same modules mentioned by the OP.
Examples:
modules/cck/content.module
modules/google_analytics/googleanalytics.module
A fix would be appreciated
Peter
Comment #6
ruplAnother good example would be Ubercart, which contains some submodules nested within several folders
http://git.drupalcode.org/project/ubercart.git/tree
Comment #7
dmitrig01 commentedOk, I committed a modified version of this -- thanks
Comment #8
peter.walter commentedAnother strange case is the 6.x version of the date module (http://drupal.org/project/date)
The folder structure is
Therefore in the make-generate output is listed as:
Looking at the 7.x version, it looks like the folder structure is reversed (ie date.module is in date/ and date_api.module is in date/date_api/) so the problem will go away.