terminal42 / contao-notification_center

The most popular notification configuration extension for the Contao Open Source CMS!
63 stars 38 forks source link

LocalSwitcher === null, Parcel never sealed on custom Gateway #348

Closed xprojects-de closed 2 months ago

xprojects-de commented 2 months ago

NC 2.0.10 under C 4.13 (2.0.9 is working)

Using Contao 4.13 (Symfony 5.4) and customGateway under NC 2.0.10 the LocalSwitcher is null:

https://github.com/terminal42/contao-notification_center/blob/86388e4389d16877a0779b9507c1f34b8434c4cc/src/NotificationCenter.php#L301

So the Parcel is never sealed and there is an Exception:

[2024-07-03T19:44:40.217401+02:00] contao.error.ERROR: The parcel did not contain all required stamps. Provided: [Terminal42\NotificationCenterBundle\Parcel\Stamp\NotificationConfigStamp, Terminal42\NotificationCenterBundle\Parcel\Stamp\TokenCollectionStamp, Terminal42\NotificationCenterBundle\Parcel\Stamp\GatewayConfigStamp, Terminal42\NotificationCenterBundle\Parcel\Stamp\LanguageConfigStamp, Alpdesk\AlpdeskBooking\Library\Notifications\AlpdeskBookingGatewayConfigStamp], Required: [Alpdesk\AlpdeskBooking\Library\Notifications\AlpdeskEmailStamp]. {"exception":"[object] (Terminal42\\NotificationCenterBundle\\Exception\\Parcel\\CouldNotDeliverParcelException(code: 0): The parcel did not contain all required stamps. Provided: [Terminal42\\NotificationCenterBundle\\Parcel\\Stamp\\NotificationConfigStamp, Terminal42\\NotificationCenterBundle\\Parcel\\Stamp\\TokenCollectionStamp, Terminal42\\NotificationCenterBundle\\Parcel\\Stamp\\GatewayConfigStamp, Terminal42\\NotificationCenterBundle\\Parcel\\Stamp\\LanguageConfigStamp, Alpdesk\\AlpdeskBooking\\Library\\Notifications\\AlpdeskBookingGatewayConfigStamp], Required: [Alpdesk\\AlpdeskBooking\\Library\\Notifications\\AlpdeskEmailStamp]

I think the Parcel must be sealed also when LocalSwitcher is null.

Toflar commented 2 months ago

Can you check if https://github.com/terminal42/contao-notification_center/pull/349 fixes the issue? Sorry, I have no more projects running 4.13 so I usually don't notice issues with v4 anymore 😇

xprojects-de commented 2 months ago

@Toflar Thanks. Working fine!