Yoast/Yoast-SEO-for-TYPO3

PHP 8 throws exceptions due to missing array checks in SnippetPreview

Bunnyfield opened this issue · 1 comments

protected function initialize(): void

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';
RinyVT commented

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!