Skip to content

Fix: Block fields in object bricks are always output as null even though they are filled#734

Merged
mcop1 merged 3 commits intopimcore:1.5from
blankse:fix_block_in_object_brick
May 5, 2023
Merged

Fix: Block fields in object bricks are always output as null even though they are filled#734
mcop1 merged 3 commits intopimcore:1.5from
blankse:fix_block_in_object_brick

Conversation

@blankse
Copy link
Contributor

@blankse blankse commented Apr 26, 2023

Field config:

  -
      attributes:
          attribute: '?{"containerKey":"BrickName","fieldname":"fieldName","brickfield":"blockField"}~blockField'
          label: Test
          dataType: block
      isOperator: false

GraphQL Query:

{
  getTestClass(id: 123) {
    testDE: test(language: "de") {
      medium
    }
    testEN: test(language: "en") {
      medium
    }
  }
}

Output before:

{
  "data": {
    "getTestClass": {
      "testDE": null,
      "testEN": null
    }
  }
}

Output after first commit:

{
  "data": {
    "getTestClass": {
      "testDE": [
        {
          "medium": "Luft"
        }
      ],
      "testEN": [
        {
          "medium": "Luft"
        }
      ]
    }
  }
}

Output after last commit:

{
  "data": {
    "getTestClass": {
      "testDE": [
        {
          "medium": "Luft"
        }
      ],
      "testEN": [
        {
          "medium": "Air"
        }
      ]
    }
  }
}

@fashxp fashxp added the Bug label May 4, 2023
@fashxp fashxp added this to the 1.5.7 milestone May 4, 2023
@mcop1 mcop1 self-assigned this May 5, 2023
@mcop1
Copy link
Contributor

mcop1 commented May 5, 2023

Thank you!

@mcop1 mcop1 merged commit 55683f7 into pimcore:1.5 May 5, 2023
@blankse blankse deleted the fix_block_in_object_brick branch May 5, 2023 10:46
mcop1 pushed a commit that referenced this pull request May 10, 2023
…ugh they are filled (#734)

* Fix: Block fields in object bricks are always output as null even though they are filled

* Fix PhpStan

* Fix: language arg is ignored
@lukmzig lukmzig added this to the 1.5.7 milestone May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants