Skip to content

Commit 271bed0

Browse files
committed
B2B-2257: availableStores GraphQl query has no cache identity
1 parent 138f451 commit 271bed0

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

app/code/Magento/StoreGraphQl/Model/Resolver/Stores/ConfigIdentity.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function getIdentities(array $resolvedData): array
3838
}
3939
if (!empty($resolvedData)) {
4040
$websiteId = $resolvedData[0]['website_id'];
41-
$currentStoreGroupId = $this->getCurrectStoreGroupId($resolvedData);
41+
$currentStoreGroupId = $this->getCurrentStoreGroupId($resolvedData);
4242
$groupTag = $currentStoreGroupId ? 'group_' . $currentStoreGroupId : '';
4343
$ids[] = sprintf('%s_%s', StoreConfigIdentity::CACHE_TAG, 'website_' . $websiteId . $groupTag);
4444
}
@@ -47,12 +47,12 @@ public function getIdentities(array $resolvedData): array
4747
}
4848

4949
/**
50-
* Return current store group id if it is certain that useCurrentGroup is true in the querry
50+
* Return current store group id if it is certain that useCurrentGroup is true in the query
5151
*
5252
* @param array $resolvedData
5353
* @return string|int|null
5454
*/
55-
private function getCurrectStoreGroupId(array $resolvedData)
55+
private function getCurrentStoreGroupId(array $resolvedData)
5656
{
5757
$storeGroupCodes = array_unique(array_column($resolvedData, 'store_group_code'));
5858
if (count($storeGroupCodes) == 1) {

dev/tests/api-functional/testsuite/Magento/GraphQl/Store/AvailableStoresCacheTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2204,6 +2204,7 @@ public function testCachePurgedWithNewStoreCreatedInOneStoreGroupWebsite(): void
22042204
$registry->unregister('isSecureArea');
22052205
$registry->register('isSecureArea', true);
22062206
$store->delete();
2207+
$storeGroup->delete();
22072208
$registry->unregister('isSecureArea');
22082209
$registry->register('isSecureArea', false);
22092210
}

0 commit comments

Comments
 (0)