Skip to content

Commit

Permalink
Use uri from an alias when that alias has no root. (#3241)
Browse files Browse the repository at this point in the history
  • Loading branch information
weitzman authored Dec 13, 2017
1 parent a765db4 commit 8ac98b8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public function refineUriSelection($cwd)
return;
}
$selfAliasRecord = $this->aliasManager->getSelf();
if (!$selfAliasRecord->hasRoot()) {
if (!$selfAliasRecord->hasRoot() && !$this->bootstrapManager()->drupalFinder()->getDrupalRoot()) {
return;
}
$uri = $selfAliasRecord->uri();
Expand Down
10 changes: 6 additions & 4 deletions src/Preflight/Preflight.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,13 @@ protected function findSelectedSite()
*/
protected function setSelectedSite($selectedRoot, $fallbackPath = false)
{
$foundRoot = $this->drupalFinder->locateRoot($selectedRoot);
if (!$foundRoot && $fallbackPath) {
$this->drupalFinder->locateRoot($fallbackPath);
if ($selectedRoot || $fallbackPath) {
$foundRoot = $this->drupalFinder->locateRoot($selectedRoot);
if (!$foundRoot && $fallbackPath) {
$this->drupalFinder->locateRoot($fallbackPath);
}
return $this->drupalFinder()->getDrupalRoot();
}
return $this->drupalFinder()->getDrupalRoot();
}

/**
Expand Down

0 comments on commit 8ac98b8

Please sign in to comment.