This repository was archived by the owner on Dec 19, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 150
This repository was archived by the owner on Dec 19, 2019. It is now read-only.
cms block, get by identifier and #635
Copy link
Copy link
Closed
Labels
Component: CmsGraphQlContribution DayTickets is good for start on Contribution DayTickets is good for start on Contribution DaybugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
Milestone
Description
Preconditions (*)
- Magento 2.3.2
Steps to reproduce (*)
- Create atleast 2 store views
- Create 2 cms blocks, with the same identifier, set storeview scope two the 2 different store views created at the top
3: Get the cms block with the identifier - it will ALWAYS get the cms block from the default webstore.
4: (You can check withstoreConfig: { code }that you actually are running with a different scope.
My current setup
Expected result (*)
- The content from the cms block with the content from the scoped cms block
Actual result (*)
- Always the default cms block, properly actually the first element found in the database with the cms block identifier.
From my current setup (see screenshot above) when I run the following graphql
{
storeConfig {
code
}
cmsBlocks(identifiers: "footer-block-one") {
items {
content
}
}
}
I get this result
{
"data": {
"storeConfig": {
"code": "english"
},
"cmsBlocks": {
"items": [
{
"content": "<p>Danish</p>"
}
]
}
}
}
Where the content should be english
3: If you disable the first cms block (the Danish one in my above setup), you will be thrown a NotFoundException, even though the english cms block still is enabled.
https://github.com/magento/graphql-ce/blob/2.3-develop/app/code/Magento/CmsGraphQl/Model/Resolver/DataProvider/Block.php#L51
A storeview code should be added around here
Metadata
Metadata
Assignees
Labels
Component: CmsGraphQlContribution DayTickets is good for start on Contribution DayTickets is good for start on Contribution DaybugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
