Skip to content

Commit

Permalink
prevent PHP error for store without currency
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackbitDevs committed May 19, 2024
1 parent fa808e3 commit 214a616
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/CoreShop/Bundle/CoreBundle/CoreExtension/StoreValues.php
Original file line number Diff line number Diff line change
Expand Up @@ -606,9 +606,12 @@ public function getDataForEditmode(mixed $data, Concrete $object = null, array $
$context->setGroups($params['groups'] ?? ['Default', 'Detailed']);
$values = $this->getSerializer()->toArray($storeValuesEntity, $context);

$store = $storeValuesEntity->getStore();
$currency = $store->getCurrency();

$storeData[$storeValuesEntity->getStore()->getId()] = [
'name' => $storeValuesEntity->getStore()->getName(),
'currencySymbol' => $storeValuesEntity->getStore()->getCurrency()->getSymbol(),
'name' => $store->getName(),
'currencySymbol' => $currency ? $currency->getSymbol() : null,
'values' => $values,
'inherited' => false,
'inheritable' => $inheritable,
Expand Down

0 comments on commit 214a616

Please sign in to comment.