Skip to content

Commit

Permalink
#3780 store handle not being passed to store management templates
Browse files Browse the repository at this point in the history
  • Loading branch information
nfourtythree committed Nov 26, 2024
1 parent a02a5d3 commit 16100ff
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Fixed a bug where variant prices could display incorrectly when inline editing. ([#3768](https://github.com/craftcms/commerce/issues/3768))
- Fixed a performance degradation bug with variant queries. ([#3758](https://github.com/craftcms/commerce/issues/3758))
- Fixed a PHP error that could occur when managing store settings. ([#3780](https://github.com/craftcms/commerce/issues/3780))

## 5.2.5 - 2024-11-20

Expand Down
10 changes: 10 additions & 0 deletions src/controllers/BaseStoreManagementController.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ public function init(): void
public function renderTemplate(string $template, array $variables = [], ?string $templateMode = null): YiiResponse
{
$variables['storeSettingsNav'] = $this->getStoreSettingsNav();

if (!isset($variables['storeHandle'])) {
$routeParams = Craft::$app->getUrlManager()->getRouteParams();

Check failure on line 45 in src/controllers/BaseStoreManagementController.php

View workflow job for this annotation

GitHub Actions / ci / Code Quality / PHPStan / PHPStan

Call to an undefined method yii\web\UrlManager::getRouteParams().

// Make sure store handle is always passed to the template
if (isset($routeParams['storeHandle'])) {
$variables['storeHandle'] = $routeParams['storeHandle'];
}
}

return parent::renderTemplate($template, $variables, $templateMode);
}

Expand Down

0 comments on commit 16100ff

Please sign in to comment.