Open Skatox opened 4 days ago
Not sure if it's preexisting or linked via one of our PRs, but I'm pretty sure I've addressed this upstream (assumed the issue was only in the branch) at https://github.com/rtCamp/wp-graphql-content-blocks/pull/31
Should have time to backport a fix this week 🤞
On second look, I'm unable to replicate this using the latest main
(v4.3.0)
@Skatox would you be able to confirm what version of plugin you are using and provide a replicable test case?
Here's mine:
Post content:
<!-- wp:buttons -->
<div class="wp-block-buttons"><!-- wp:button -->
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button"></a></div>
<!-- /wp:button --></div>
<!-- /wp:buttons -->
<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->
Query:
query TestButtons($uri: String!) {
nodeByUri(uri:$uri){
... on NodeWithEditorBlocks {
editorBlocks{
__typename
... on CoreButtons {
attributes {
align
anchor
backgroundColor
borderColor
className
cssClassName
fontFamily
fontSize
gradient
layout
lock
metadata
style
}
}
... on CoreButton {
attributes {
anchor
backgroundColor
borderColor
className
cssClassName
fontFamily
fontSize
gradient
placeholder
linkClassName
linkTarget
lock
metadata
placeholder
rel
style
tagName
text
textAlign
textColor
title
type
url
width
}
}
}
}
}
}
Results:
If you do:
You'll get an
internal server error
saying thatdomdocument::loadHTML(): Argument #1 ($source) must not be empty when the button is empty
. If you add some text to the button, the problem will disappear.This is a problem if you rebuild multiple pages and one of them has an information skeleton without any values. It won't work.