-
Notifications
You must be signed in to change notification settings - Fork 17
Type Error: current ZoneSite #176
Copy link
Copy link
Open
Description
| Q | A |
|---|---|
| Bug report? | yes |
| Feature request? | no |
| BC Break report? | no |
| RFC? | no |
In different scenarios, the following Error occurred:
TypeError
I18nBundle\Context\I18nContext::getCurrentZoneSite(): Return value must be of type I18nBundle\Model\ZoneSiteInterface, null returned
The return type of determinateCurrentZoneSite() in https://github.com/dachcom-digital/pimcore-i18n/blob/master/src/Context/I18nContext.php#L277 is nullable, also the property currentZoneSite.
Therefore, cases may occur, where currentZoneSite of the i18n context is null.
But the return type of getCurrentZoneSite() in https://github.com/dachcom-digital/pimcore-i18n/blob/master/src/Context/I18nContext.php#L66 is non-nullable.
Calling this getter when the property is null leads to this error and the whole thing crashes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels