wp-graphql-content-blocks
wp-graphql-content-blocks copied to clipboard
CoreTable column alignment returns null
The core table block is returning null values for cell alignment even when it is set. The cell alignment is instead set by the whole table alignment. This seems like a mistake.
Steps to reproduce
- Add a core table into a page and adjust the alignment on a column (not the alignment of the table).
- Add this into your page query:
editorBlocks {
... on CoreTable {
attributes {
body {
cells {
align
}
}
foot {
cells {
align
}
}
head {
cells {
align
}
}
}
}
}
Can also add to this that we are seeing all of our CoreTable cell values return null. Most concerning, content
returns null even though I can confirm we have content in all of our test body cells.
"body": [
{
"cells": [
{
"align": null,
"colspan": null,
"content": null,
"rowspan": null,
"scope": null
},
{
"align": null,
"colspan": null,
"content": null,
"rowspan": null,
"scope": null
}
]
},
Hey @phillubliner and @brysonchiu I've reproduced this issue and I will provide a fix soon.
@phillubliner @brysonchiu
https://github.com/wpengine/wp-graphql-content-blocks/releases/tag/v4.0.1
Should contain a fix for this issue. I'm closing this ticket but feel free to comment back if you still have any problems.
content
is still null
Hello @theodesp, I can confirm the same: content
still returns null
. Is there any news on this? Thanks!
I think the content problem is here: https://github.com/wpengine/wp-graphql-content-blocks/blob/7c3a6d7e2b0825f9e3cdd9e6411152d4957bb114/includes/Blocks/Block.php#L139
The content of the table cells is in the format <TD>TheContent</TD>
and must be parsed as html but the source is rich-text. If i change to
case 'rich-text': $result[$key] = $this->parse_single_source($html, 'html'); break;
The cells are populated but I'am not deep enough in the topic to understand if this will course strange functions in other attributes.
@theodesp
I have just updated to the latest WP, 6.6.1, and the latest wp-graphql-content-blocks, 4.1.0, and the cell alignment is still returning null. Im updating from WP 6.4.5 and wp-graphql-content-blocks 3.1.2.
Additionally, like others have stated, the content is too returning null. This is a new issue for me since updating.
Should I open a new issue or continue with this thread?