Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect composer root identified when two composer.json files are present #30

Open
grasmash opened this issue Sep 25, 2017 · 3 comments

Comments

@grasmash
Copy link

grasmash commented Sep 25, 2017

I have a directory structure like this:

composer.json
docroot
    - composer.json
vendor

When I am working in the docroot directory, Drupal finder incorrectly identifies the docroot as the composer root.

I believe that this is a valid use case.

@grasmash
Copy link
Author

Perhaps it would be sufficient to verify that the vendor directory exists in the composer root?

@grasmash grasmash changed the title Incorrect composer root identified went to composer.json files are present Incorrect composer root identified when two composer.json files are present Oct 21, 2017
@webflo
Copy link
Owner

webflo commented Apr 8, 2019

The --debug flag helps to identify these issues.

A check for the vendor folder may point people in the wrong direction. E.g. running composer install in the docroot is not the proper solution for this kind of problem. The composer.json is docroot should be removed.

@cmlara
Copy link

cmlara commented Sep 27, 2024

I believe #73 may have fixed this issue too.

I was encountering the same fault (where I have a fully formed composer.json in one of my modules folders that includes install-paths for drupal/core) and with the latest release the flaw appears to have gone away.

I do not directly use drupal-finder. I encountered this through mglaman/phpstan-drupal's need to find the root folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants