Skip to content

Commit

Permalink
FRW-6368 Fixed required store param for old Glue (#10774)
Browse files Browse the repository at this point in the history
FRW-6368 Fixed default store resolving for Glue.
  • Loading branch information
dimitriyTsemma authored Jan 31, 2024
1 parent b3ff118 commit eb3bb3f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ public function isDynamicStoreEnabled(): bool
}

/**
* @param bool $fallbackToDefault
*
* @return \Generated\Shared\Transfer\StoreTransfer
*/
public function getCurrentStore(): StoreTransfer
public function getCurrentStore(bool $fallbackToDefault = false): StoreTransfer
{
return $this->storeFacade->getCurrentStore();
return $this->storeFacade->getCurrentStore($fallbackToDefault);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ interface LocaleToStoreFacadeInterface
public function isDynamicStoreEnabled(): bool;

/**
* @param bool $fallbackToDefault
*
* @return \Generated\Shared\Transfer\StoreTransfer
*/
public function getCurrentStore(): StoreTransfer;
public function getCurrentStore(bool $fallbackToDefault = false): StoreTransfer;
}
2 changes: 1 addition & 1 deletion src/Spryker/Zed/Locale/LocaleDependencyProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ protected function addCurrentLocale(Container $container): Container
return $container->getApplicationService(static::SERVICE_LOCALE);
}

return $localeToStoreBridge->getCurrentStore()->getDefaultLocaleIsoCode();
return $localeToStoreBridge->getCurrentStore(true)->getDefaultLocaleIsoCode();
});

return $container;
Expand Down

0 comments on commit eb3bb3f

Please sign in to comment.