Skip to content
This repository was archived by the owner on Dec 19, 2019. It is now read-only.
This repository was archived by the owner on Dec 19, 2019. It is now read-only.

cms block, get by identifier and  #635

@lsv

Description

@lsv

Preconditions (*)

  1. Magento 2.3.2

Steps to reproduce (*)

  1. Create atleast 2 store views
  2. 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 with storeConfig: { code } that you actually are running with a different scope.

My current setup

Screenshot from 2019-04-29 13-45-18

Expected result (*)

  1. The content from the cms block with the content from the scoped cms block

Actual result (*)

  1. 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

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions