Skip to content

Commit

Permalink
Fixed an issue with the configurations not being loaded on existing e…
Browse files Browse the repository at this point in the history
…ntries for non-default sites

Fixes #54
  • Loading branch information
joshangell committed Apr 5, 2019
1 parent a4c6d87 commit 3c20701
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/services/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,15 @@ public function run()
$entryType = reset($sectionEntryTypes);
} else {
$entryId = (integer)explode('-', $segments[2])[0];
$entry = Craft::$app->entries->getEntryById($entryId);

// Check if we have a site handle in the URL
if (isset($segments[3])) {
// If we do, get the site and fetch the entry with it
$site = Craft::$app->sites->getSiteByHandle($segments[3]);
$entry = Craft::$app->entries->getEntryById($entryId, $site !== null ? $site->id : null);
} else {
$entry = Craft::$app->entries->getEntryById($entryId);
}

if ($entry)
{
Expand Down

0 comments on commit 3c20701

Please sign in to comment.