Skip to content

Commit 3dd984b

Browse files
committed
Make sure the links are directed to the active store
if locale fallback is enabled the current store should resolve those links locally
1 parent cbfdec2 commit 3dd984b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ViewModel/LinkResolver.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,14 @@ private function getLanguageStoreIds(): array
281281
$languageStoreIds[$languageCode] = $languageStoreIds[$languageCode] ?? +$store->getId();
282282
}
283283

284+
/**
285+
* If locale fallback is enabled, make sure those requests will be directed to this store
286+
*/
287+
$currentStore = $this->storeManager->getStore();
288+
if ($this->configuration->hasContentLanguageFallback($this->storeManager->getStore())) {
289+
$languageStoreIds[$this->configuration->getContentLanguageFallback($currentStore)] = +$currentStore->getId();
290+
}
291+
284292
$this->cachedLanguageStoreIds = $languageStoreIds;
285293
return $languageStoreIds;
286294
}

0 commit comments

Comments
 (0)