Skip to content
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

Attributes for paragraph block nested inside a column block not working #2

Closed
EarthlingDavey opened this issue Apr 27, 2019 · 4 comments

Comments

@EarthlingDavey
Copy link

The attributes for a paragraph block nested inside a column block are not working.

__typename on the attribute field causes an Internal server error.

Expected Behavior

Nested paragraph attributes are available - my test shows nested headings and images are working OK.

Steps to Reproduce

Create a columns layout block in the editor. Add a heading and paragraph on left, and image block on right.

Running the following query I get the following response.

Query

query pages {
  pageBy( uri: "home") {
    id
    blocks {
      ... on CoreColumnsBlock {
        innerBlocks {
          ... on CoreColumnBlock {
            innerBlocks {
              ... on CoreHeadingBlock {
                attributes {
                  ... on CoreHeadingBlockAttributes {
                    content
                  }
                }
              }
              ... on CoreParagraphBlock {
                originalContent
                isValid
                attributes {
                  __typename
                  ... on CoreParagraphBlockAttributesV3 {
                    content
                  }
                }
              }
              ... on CoreImageBlock {
                attributes {
                  ... on CoreImageBlockAttributes {
                    url
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

Response

{
  "errors": [
    {
      "message": "Internal server error",
      "category": "internal",
      "locations": [
        {
          "line": 19,
          "column": 17
        }
      ],
      "path": [
        "pageBy",
        "blocks",
        1,
        "innerBlocks",
        0,
        "innerBlocks",
        1,
        "attributes"
      ]
    }
  ],
  "data": {
    "pageBy": {
      "id": "cGFnZTo2MA==",
      "blocks": [
        {},
        {
          "innerBlocks": [
            {
              "innerBlocks": [
                {
                  "attributes": {
                    "content": "Our story"
                  }
                },
                {
                  "originalContent": "<p>Hi there</p>",
                  "isValid": true,
                  "attributes": null
                }
              ]
            },
            {
              "innerBlocks": [
                {
                  "attributes": {
                    "url": "http://localhost/wp/wp-content/uploads/2019/04/bay-1787065_1920-1024x683.jpg"
                  }
                }
              ]
            }
          ]
        },
        {},
        {},
        {},
        {}
      ]
    }
  }
}
@pristas-peter
Copy link
Owner

Will look into this. Thanks

@EarthlingDavey
Copy link
Author

Awesome, cheers!

@pristas-peter
Copy link
Owner

@DaveyBrown Should work now. But you need to re-save the post you were working on, or rather use the Update all posts which support editor button in admin menu.

@EarthlingDavey
Copy link
Author

Great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants