When downloading a module with package manager set to git_drupalorg and gitsubmodule set to TRUE, the module is downloaded to the correct location, but the submodule is set to a directory with the module name in the project root. For example /simpletest is used, not /sites/all/modules/simpletest.
Dumping the command array in git_drupalorg.inc showed that the destination arg was set to FALSE instead of a string:
array(4) {
[0]=>
string(17) "git submodule add"
[1]=>
NULL
[2]=>
string(43) "git://git.drupal.org/project/simpletest.git"
[3]=>
bool(false)
}
Checking out the $project array, it looks like the value of full_project_path may have changed from a full path to a relative path, so the substr call is now failing. Here's the dump of $project:
array(10) {
["name"]=>
string(10) "simpletest"
["version"]=>
NULL
["drupal_version"]=>
string(3) "6.x"
["project_version"]=>
NULL
["project_type"]=>
string(6) "module"
["project_dir"]=>
string(10) "simpletest"
["base_project_path"]=>
string(10) "simpletest"
["full_project_path"]=>
string(36) "sites/all/modules/contrib/simpletest"
["repository"]=>
string(43) "git://git.drupal.org/project/simpletest.git"
["project_install_location"]=>
string(36) "sites/all/modules/contrib/simpletest"
}
Using $project['full_project_path'] without the substr parsing fixed the issue.
Comments
Comment #0.0
ethanw commentedFormatted var dumps with code.
Comment #1
ethanw commentedPatch attached.
Comment #2
rfayYup, this patch fixes this problem for me.
Without the patch, if, with gitsubmodule enabled, you do a
drush dl --destination=sites/all/modules ctools-7.x-1-x-devCtools will be cloned... and it will tell you it's looking at sites/all/modules... but when it's all done the module will be in modules instead of sites/all/modules
Comment #3
moshe weitzman commentedHopefully jonhattan can review and commit. If he is unavailable, I will do so in a couple days.
Comment #4
jonhattanThe source of the problem is earlier.
Comment #5
jonhattanComment #6
jonhattanfixed in master.
Comment #7
moshe weitzman commentedI'm seeing a new bug with --destination. Notice 'Array' below:
Comment #8
jhedstromI think you meant to assign this to jonhattan
Comment #9
jonhattanFixed and added tests for it.
http://drupalcode.org/project/drush.git/commitdiff/f7382c4?hp=3566e6b72d...
Also I didn't realize there were commits to test --select conflicting me. So I did a merge and separate --select checks to its own test/function. Hope this is right: http://drupalcode.org/project/drush.git/commitdiff/782917a
Comment #10
jonhattanComment #11
msonnabaum commentedFix and new tests backported.
Comment #12
rfayHowever... #1372442: drush dl (--gitsubmodule) downloads extra pieces into /modules (and points there with .gitmodules) when symlinked parent dir still remains a live issue. Is it the same thing?
Comment #13.0
(not verified) commentedFormatted var dumps with code.