Open Etroid opened 5 years ago
Did you specify a name property in your composer.json?
yes, the snippet is just part of the entire composer.json file All was working last week, a few days before the latest release of drupal-finder
Check if your main project composer.json
is set to:
{
"name": "drupal/drupal",
...
I had an old project I inherited that must have been initially modelled on the drupal composer.json. The update on Aug 2 added logic that looks for drupal/drupal
and sets the Drupal Root incorrectly.
I'm guessing this was webflo's hunch...
Something to note, this problem didn't occur for me when the entry point was Drush launcher. It only occured when i was explicitly doing like ../vendor/bin/drush status
from the Drupal root.
^^ @simesy correct, I was not using drush launcher when I encountered the problem. It was working before the latest release however.
@Etroid you haven't verified what that value of "name" is in your composer.json.
@simesy, name is "name": "tableau/www"
so should not be related.
Same issue here, using the lightning distribution.
"name": "drupal/drupal",
Except the composer.json isn't in the docroot, but one directory outside of it for security reasons.
I think that is related to the issue. I downgraded to 1.1.0 for now to get it working.
So a quick fix:
composer require webflo/drupal-finder:1.1.0
@Techwolf12 yeah that is pretty standard, drupal-finder is designed start in the docroot and look up a directory for the composer file.
"name": "drupal/drupal",
is arguably incorrect because it collides with the well known composer package drupal/drupal
, see attached image as evidence that Composer assumes this would never happen. It works because you're likely requiring bringing in the composer-friendly variation drupal/core
.
I would change it. I've never seen negative consequences of changing it. I usually change it to ORGANISATION/PROJECT
.
Or remove it, there's no need for a "name"
in a not-published Composer project.
DrupalFinder is unable to detect drupalRoot is
/web
when using drupal core 8.7 - usingwikimedia/composer-merge-plugin
. Instead, it thinks the drupalRoot is/
.This issue occurs when running any
drush
ordrupal
command.From what I gather this is because of a recent change to support Drupal core 8.8 (i.e. https://www.drupal.org/project/drupal/issues/2912387#comment-13188592)