Yoast-SEO-for-TYPO3
Yoast-SEO-for-TYPO3 copied to clipboard
PHP 8 throws exceptions due to missing array checks in SnippetPreview
https://github.com/Yoast/Yoast-SEO-for-TYPO3/blob/9cb948047d706f6174b6ed49def8275d299f8f33/Classes/Form/Element/SnippetPreview.php#L99
The lines should probably look like this instead:
$this->titleField = $this->data['parameterArray']['fieldConf']['config']['settings']['titleField'] ?? 'title';
$this->pageTitleField = $this->data['parameterArray']['fieldConf']['config']['settings']['pageTitleField'] ?? 'title';
$this->descriptionField = $this->data['parameterArray']['fieldConf']['config']['settings']['descriptionField'] ?? 'description';
Hi @Bunnyfield,
Seems like a logical thing to change, but I'm wondering where or in what situation you encounter these errors?
When the snippet preview is rendered within the page properties the array should always be available, does this error occur within pages or within another configured record where the TCA configuration is missing perhaps?
I cannot reproduce this error, not even with E_ALL
error reporting.
Nonetheless, will make a change for it!