Composer Manager does not respect $conf['composer_manager_vendor_dir'] from settings.php on install. This is due to variable_set in the composer_manager_install() function at time of install.

To reproduce:

- Create a fresh Drupal install.

- Add the following to settings.php:

$site_dir = basename(__DIR__);
$conf['composer_manager_vendor_dir'] = '../lib/' . $site_dir . '/vendor';
$conf['composer_manager_file_dir'] = '../lib/' . $site_dir;

- Add a small custom module per https://www.acquia.com/blog/using-composer-manager-get-island-now

- Install the custom module with drush or from the Drupal admin.

- Review the composer_manager-generated composer.json file, which is pointing to 'sites/all/vendor'.

Note, this is only an issue in 7.x-1.x. The hard-coded variable_set has been removed from the 7.x-2.x version.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

n8nl’s picture

Patch attached. This will respect composer_manager_vendor_dir from settings.php $conf.

n8nl’s picture

Status: Active » Needs review
cpliakas’s picture

Priority: Normal » Major
Status: Needs review » Reviewed & tested by the community

Great catch! Thanks for the contribution.

  • cpliakas committed 6181dc5 on 7.x-1.x authored by nhoag
    Issue #2340759 by nhoag: Respect composer_manager_vendor_dir value from...
cpliakas’s picture

Status: Reviewed & tested by the community » Fixed
n8nl’s picture

Whoops! Looks like my previous patch caused the install file to go into the ether. New patch attached in case you're able to roll back and re-apply.

n8nl’s picture

And another in case you're not able to roll back.

bojanz’s picture

Status: Needs review » Fixed

Committed #7, thanks.

  • bojanz committed 7af033c on 7.x-1.x authored by nhoag
    Issue #2340759 by nhoag: Respect composer_manager_vendor_dir value from...

Status: Fixed » Closed (fixed)

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