-
Notifications
You must be signed in to change notification settings - Fork 9.4k
magento/magento2#28569:Multi-store: Missing store codes in relation t… #28794
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
magento/magento2#28569:Multi-store: Missing store codes in relation t… #28794
Conversation
…bsite - Added stores for storeConfig query
Hi @gallyamov. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
You can find more information about the builds here ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review. For more details, please, review the Magento Contributor Guide documentation. |
@magento run all tests |
@magento run Functional Tests B2B |
@magento run Functional Tests B2B |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @gallyamov!
Please check my comments.
app/code/Magento/StoreGraphQl/Model/Resolver/Store/StoreConfigDataProvider.php
Outdated
Show resolved
Hide resolved
app/code/Magento/StoreGraphQl/Model/Resolver/Store/StoreConfigDataProvider.php
Outdated
Show resolved
Hide resolved
…adding_stores_to_store_config
- Refactored code to use getList
- Added param type hint
@magento run all tests |
Hi @gallyamov |
@gallyamov Can you please implement this using the schema defined here: magento/architecture#390 |
…adding_stores_to_store_config
…ebsite - Implemented new availableStores query - Code refactor
@magento run all tests |
*/ | ||
protected function getStoreConfig($store) | ||
public function getStoreConfig($store) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need this change, and I would prefer to avoid it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know we discussed this offline and thought it might not be a big deal.
However, now the class's api differs from it's interface, and updating the interface would be backwards incompatible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can cache values in getStoreConfigs, so it fetches data just once
then you can call getStoreConfigs([$store->getCode()])
instead of calling getStoreConfig($store)
It's the same thing
{ | ||
$storeConfig = current($this->storeConfigManager->getStoreConfigs([$store->getCode()])); | ||
$storesConfigData = []; | ||
$storeConfigs = $this->storeConfigManager->getStoreConfigs(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should only return available stores for the current website. This is returning all stores for all websites
* @magentoConfigFixture test_store store/information/name Test Store | ||
* @throws Exception | ||
*/ | ||
public function testAvailableStoreConfigs(): void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be in a separate test file since it's testing a different query/resolver
…adding_stores_to_store_config
…ebsite - Created separate test for available stores Added website specific store output
@magento run all tests |
{ | ||
$storeConfig = current($this->storeConfigManager->getStoreConfigs([$store->getCode()])); | ||
$websiteStores = $this->storeWebsiteRelation->getWebsiteStores($websiteId, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need a (int) typecast, and plz do that int $websiteID in methods, it's the preferred way
@gallyamov, FYI "testDefaultWebsiteAvailableStoreConfigs" test is failing |
…adding_stores_to_store_config
…ebsite - Fixed strict types and tests
@magento run all tests |
Hi @swnsma, thank you for the review. |
Hi @gallyamov, thank you for your contribution! |
Description (*)
This is for #28569
Related Pull Requests
N/A
Fixed Issues (if relevant)
Manual testing scenarios (*)
Check fixed issue for testing steps and expected results.
Questions or comments
N/A
Contribution checklist (*)