Problem/Motivation

When we using composer manager to manage Drupal module packages with composer we does not add explicitly the dependencies of modules into composer.json of application but we should have all packages required by modules on install it.

To assume composer with pathauto we just need to add an composer.json.

Proposed resolution

Add it and inform composer we have token / ctools required.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

woprrr created an issue. See original summary.

woprrr’s picture

Berdir’s picture

We actually removed this on purpose to avoid problems with specific version dependencies and so on that we had before. drupal.org automatically adds this.

woprrr’s picture

Ok @Berdir, but for now we have a small 'sémantic' problem about that when we manage our project with composer. We are forced to add token/ctools into composer.json on global project and that is my problem. What's the problem about specific version dependencies ? can we avoid that with extra {} to make alias ? For now except add dependencies into composer.json on my project `we don't have any solution` ? Sorry to be insistent, I just try to push my thoughts and found a solution.

Thank to your super speed response @berdir you're magic :D

Berdir’s picture

This works just fine for me on a fresh drupal-project?

$ composer create-project drupal-composer/drupal-project:8.x-dev some-dir --stability dev --no-interaction
....

$ cd some-dir
$ $ composer require drupal/pathauto:1.*
./composer.json has been updated
> DrupalProject\composer\ScriptHandler::checkComposerVersion
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 3 installs, 0 updates, 0 removals
Patching is disabled. Skipping.
  - Installing drupal/token (1.0.0-rc1) Loading from cache
Patching is disabled. Skipping.
  - Installing drupal/ctools (3.0.0-alpha27) Loading from cache
Patching is disabled. Skipping.
  - Installing drupal/pathauto (1.0.0-rc1) Loading from cache
Writing lock file
Generating autoload files

I've done absolutely nothing special.

krina.addweb’s picture

Status: Needs review » Reviewed & tested by the community

@woprrr ,Thanks for the patch , it works for me also.

woprrr’s picture

Oh ! I have a doubt about how drupal packages brings its information without composer.json to inform it, by packages informations like packagist (that sounds great but it's not our case) drupal.org seems to inform via .info of project but effectively the version granularity are * ... that seem problematic IMHO.

Yes that are done without composer.json I didn't say why previously I have these problem.

Then no need to add these issue now. Sorry for disturb @berdir we have another issue tu decide where D.O add composer.json automatically and where we can indicate to composer what version each version need specificaly ?

@krina.addweb you have an same problem with what case ? (you have updated pathauto and he can't be download your dependencies).

krina.addweb’s picture

@woprrr ,i installed this module with drush command and its working properly.using composer.json it also works for me.
thanks

Berdir’s picture

Status: Reviewed & tested by the community » Postponed

I'd talk to @Mixologic. Note that we don't specify version dependencies info.yml, I assume that if we would then it would actually respect that.

I'm setting this to postponed for now, until we have a reason to add a composer.json.

idebr’s picture

To expand on #3:

We actually removed this on purpose to avoid problems with specific version dependencies and so on that we had before. drupal.org automatically adds this.

This was done in #2766303: Remove composer.json and namespace dependencies

brayfe’s picture

Use of Drush 9 may require this project to add a composer.json file. See referencing issue for context.

xmacinfo’s picture

Status: Postponed » Closed (outdated)

Pathauto incluses a composer.json file. Let's close this issue.