Fix store resolution on multi-store headless Adobe Commerce setups (REVIEWS-4382)#68
Draft
calsmith99 wants to merge 1 commit into
Draft
Fix store resolution on multi-store headless Adobe Commerce setups (REVIEWS-4382)#68calsmith99 wants to merge 1 commit into
calsmith99 wants to merge 1 commit into
Conversation
Pass $scopeId to getStore() in UpdateProductFeed so store is resolved from config scope rather than the admin HTTP hostname. Replace $_SERVER['HTTP_HOST'] with the scope-aware base URL so the correct storefront URL is registered with integration/app-installed. Defer getStore() in Api constructor by storing StoreManagerInterface instead of calling getStore() at DI injection time — avoids the exception when no store view matches the admin backend hostname. Fixes REVIEWS-4382. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
$scopeIdtogetStore($scopeId)inUpdateProductFeed::execute()so URL resolution uses config scope rather than the admin HTTP hostname$_SERVER['HTTP_HOST']with$this->storeModel->getStore($scopeId)->getBaseUrl()sointegration/app-installedreceives the correct storefront URL, not the admin backend hostnamegetStore()inApiconstructor — storeStoreManagerInterfaceinstead of eagerly callinggetStore()at DI injection time, which threw when no store view matched the admin URLRoot cause
On single-instance multi-tenant Adobe Commerce setups, the admin backend URL (
mcprod.smokemart.com.au) is not registered as a store view. Magento'sStoreManager::getStore()with no argument tries to resolve the current store from the HTTP hostname — finding no match, it throws "The store that was requested wasn't found."The
$scopeIdwas already read from the event on line 26 ofUpdateProductFeed.phpbut never passed togetStore().Test plan
integration/app-installedFixes REVIEWS-4382
🤖 Generated with Claude Code