Skip to content

Commit

Permalink
Merge pull request #297 from AcclaroInc/hotfix/remove-source-site-on-…
Browse files Browse the repository at this point in the history
…entry-add

fix: source site setting to default while adding new entry on create order
  • Loading branch information
sidedwards authored Jan 21, 2022
2 parents d74e7d7 + dbe5a74 commit eaceb15
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/controllers/OrderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,9 @@ public function actionOrderDetail(array $variables = array())
}
}

$SourceSite = Craft::$app->getRequest()->getBodyParam('sourceSite');
$sourceSite = Craft::$app->getRequest()->getQueryParam('sourceSite') ?? Craft::$app->getRequest()->getBodyParam('sourceSite');

if ($SourceSite && !Translations::$plugin->siteRepository->isSiteSupported($SourceSite)
) {
if ($sourceSite && !Translations::$plugin->siteRepository->isSiteSupported($sourceSite)) {
Craft::$app->getSession()->setError(Translations::$plugin->translator->translate('app', 'Source site is not supported'));
return;
}
Expand All @@ -138,7 +137,7 @@ public function actionOrderDetail(array $variables = array())
throw new HttpException(404);
}
} else {
$order = $this->service->makeNewOrder($SourceSite);
$order = $this->service->makeNewOrder($sourceSite);

$orderElements= Craft::$app->getRequest()->getQueryParam('elements') ?? Craft::$app->getRequest()->getParam('elements');
$order->elementIds = json_encode($orderElements ?: []);
Expand Down

0 comments on commit eaceb15

Please sign in to comment.