When trying to use the getStructuredText function, I'm encountering this error:
Argument 2 passed to Prismic\Fragment\StructuredText::insertSpans() must be of the type array, null given,
called in vendor/prismic/php-sdk/src/Prismic/Fragment/StructuredText.php on line 277
Which in turn comes down to the TextBlock.php class. Seems like forcing the $spans class variable to default to a null fixes the problem inside the Fragment\Block\TextBlock class:
private $spans = array();
but I can't say whether that's the correct way to handle this.
When trying to use the
getStructuredText
function, I'm encountering this error:The line in question is here:
Which in turn comes down to the TextBlock.php class. Seems like forcing the $spans class variable to default to a null fixes the problem inside the Fragment\Block\TextBlock class:
but I can't say whether that's the correct way to handle this.