Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8 throws exceptions due to missing array checks in SnippetPreview #542

Open
Bunnyfield opened this issue Jul 6, 2023 · 1 comment
Open

Comments

@Bunnyfield
Copy link

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
Copy link
Collaborator

RinyVT commented Jul 27, 2023

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants