0

Forgive me as I'm new to Drupal and am getting confused about the defaults I'm seeing between different parts of the ecosystem...

I'm using Drupal 8, Drush 9 and Composer to create my project and manage my sites.

I first run:

composer create-project drupal-composer/drupal-project:8.x-dev vanilla --no-interaction

I notice that composer keeps the modules, themes and profiles under the 'web' directory.

    "installer-paths": {
        "web/core": ["type:drupal-core"],
        "web/libraries/{$name}": ["type:drupal-library"],
        "web/modules/contrib/{$name}": ["type:drupal-module"],
        "web/profiles/contrib/{$name}": ["type:drupal-profile"],
        "web/themes/contrib/{$name}": ["type:drupal-theme"],
        "drush/Commands/contrib/{$name}": ["type:drupal-drush"]
    },

I then attempt to run drush to start moving things between different sites and servers but I notice the differences.

drush rsync %modules .

Replace files in dmlb2000@X.X.X.X:/var/www/drupalvm/drupal/web/modules/ with /home/.../websites/vanilla/web/sites/all/modules/? (yes/no) [yes]

  • Why did the '@self' site alias default the modules directory to 'sites/all/modules'?
  • Which one should be the default location 'web/modules' or 'web/sites/all/modules'?
  • How can I change the '@self' alias to fix the path?
  • sites/all/modules is the Drupal 7 way, you should use web/modules in Drupal 8. – user72672 Nov 24 '19 at 9:32
  • I'm surprised that you see sites/all/modules. If you look at the function pathAliases in vendor/drush/drush/src/Commands/core/StatusCommands.php this shouldn't happen. It might be a Drush bug. We need more info about the two sites that you try to sync - Drupal and Drush versions for a start. – hansfn Nov 25 '19 at 12:07
  • Drush launcher version 0.6.0 and Drush commandline tool 9.7.1 and Drupal version 8.7.10 – David Brown Nov 25 '19 at 16:08
  • The other thought to resolve this would be to modify the path aliases for @self however I'm unsure how to do this. drush sa @self isn't very useful to generate a self alias. – David Brown Nov 25 '19 at 16:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.