Now that modules and themes live in the site root, drush should put them there when downloading :)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jenlampton’s picture

Project: Devel » Drush
Version: 8.x-1.x-dev » 8.x-6.x-dev
Component: devel » PM (dl, en, up ...)

yes, I said drush... not devel... more coffee please?

moshe weitzman’s picture

Assigned: Unassigned » jonhattan

Assigning to jonhattan, but it would be great if others could help.

greg.1.anderson’s picture

Status: Active » Needs review
FileSize
879 bytes

This should about do it, but where does themes/engines go in D8? If it's at $root/themes/engines, then this should be good.

micahw156’s picture

Patch applied cleanly, and download test worked for me. (In my case, into $root/modules/contrib)

jonhattan’s picture

Status: Needs review » Needs work
FileSize
6.3 KB

We need more than #3. Atacched is my ongoing patch.

Notes:

* In D8 profile locations are symmetric to modules & themes.
* My patch prefers /contrib/ for profiles and themes in addition to modules.

moshe weitzman’s picture

Any chance we can get a committable patch here?

jonhattan’s picture

Status: Needs work » Needs review
FileSize
11.93 KB

This is quite more than it seemed initially.

Components/commands affected so far:

0. tests
1. search path for commands
2. pm-download
3. make
4. generate
5. archive-dump

Patch attached addresses 0-3. I'm having 14 failures in tests (D7). Not sure all of them are related.

jonhattan’s picture

The 14 failures I'm facing seems related to php 5.4 --or my 5.4 dev machine.
With php 5.3 only makeMakefileCase::testMakeRecursion is failing for me, but it is not related to this patch.

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

All testsare passing for me, with and without this patch.

The code here looks good. jonhattan is welcome to commit this when he is satisfied.

jwilson3’s picture

Status: Reviewed & tested by the community » Needs work

I'm getting the following when applying the patch to 8.x-6.x branch codebase:

# git apply drush-1936866_0.patch 
drush-1936866_0.patch:181: new blank line at EOF.
+
warning: 1 line adds whitespace errors.

on a fresh install of drupal 8, using `drush si`, I have one non-core module, not enabled:

/modules/contrib/devel

before applying patch, `drush pml | grep devel` is empty.
after applying patch, `drush pml | grep devel` is still empty.

Is pm-list represented in one of the items in #7?

This also makes it impossible to run `drush en devel` or `drush en devel_generate`.

jwilson3’s picture

Hrm, can't see devel module from D8's admin UI module page either. Ignore me, until i can figure out whats going on. :-/

greg.1.anderson’s picture

Status: Needs work » Reviewed & tested by the community

Resetting status; this should be committed.

@jwilson3: This issue is about where pm-download & c. puts modules at download time; if you have continuing issues related to enabling and disabling modules, please start a new thread.

jwilson3’s picture

Ok, but `dl` doesn't work for me (trying to test this).

Note that it downloads to ~/Projects/Drupal/8.x/devel instead of ~/Projects/Drupal/8.x/modules/devel

What am I doing wrong?

# jameswilson@Macaco /usr/local/drush
# git checkout 8.x-6.x
Switched to branch '8.x-6.x'

# jameswilson@Macaco /usr/local/drush
# git apply drush-1936866_0.patch
drush-1936866_0.patch:181: new blank line at EOF.
+
warning: 1 line adds whitespace errors.

# jameswilson@Macaco /usr/local/drush
# ./drush version
 Drush Version   :  6.0-dev 

# jameswilson@Macaco ~/Projects/Drupal/8.x
# /usr/local/drush/drush dl devel
Directory /Users/jameswilson/Projects/Drupal/8.x/sites/default exists, but is not writable. Please check       [error]
directory permissions.
Project devel (8.x-1.x-dev) downloaded to /Users/jameswilson/Projects/Drupal/8.x/devel.                        [success]
Project devel contains 3 modules: devel_node_access, devel_generate, devel.
jwilson3’s picture

Update: not sure what happened, but it works better now... re-checked out origin/8.x-6.x (weird). I also fixed folder perms on sites/default/.

# drush dl devel
Project devel (8.x-1.x-dev) downloaded to /Users/jameswilson/Projects/Drupal/8.x/sites/default/modules/devel. [success]
Project devel contains 3 modules: devel_node_access, devel_generate, devel.

But i thought it's still supposed to download to /modules instead of sites/default/modules/ ?

jonhattan’s picture

Title: Drush dl needs to put files in /modules or /themes, not /sites/whatever » Drush dl needs to put files in /modules or /themes, not /sites/all/whatever
Status: Reviewed & tested by the community » Fixed

Committed.

re #14: Before this patch, if sites/all doesn't exist, drush enforces sites/default/modules

moshe weitzman’s picture

Priority: Normal » Critical
Status: Fixed » Active
Issue tags: +Release blocker

Pretty sure this broke the tests. Assigning to jonhattan.

For example, if you run you get phpunit pmDownloadTest.php

Fatal error: Call to undefined function drush_drupal_major_version() in /Users/moshe.weitzman/Dropbox/root/c/h/drush/tests/drush_testcase.inc on line 309
moshe weitzman’s picture

Status: Active » Fixed

Fixed in db6322a

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