-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Fix custom notification object #9311
Fix custom notification object #9311
Conversation
Duplicate of #9299? |
Fixed the same issue without exposing unnecessary info |
I don't think I understand how it works? |
in this file filament/packages/notifications/src/Livewire/Notifications.php Lines 35 to 42 in 73d6c1c
here it will return the filament/packages/notifications/src/Notification.php Lines 88 to 91 in 73d6c1c
and it continues to configure the object with the array data, thus it never gets to call to with this fix if (is_subclass_of($static::class, self::class) && get_called_class() === self::class) {
$static = $static::fromArray($data);
} it checks if the |
Thanks! |
closes #9268
when recreating the notification object from array,
Notification
class resolved the correctCustomNotification
but theCustomNotification::fromArray
is not called again. this PR fixes that by checking if the notification object resolved from container is custom and its called fromNotification
class to ensure its only called once and prevent infinite loopanother approach would be in livewire\Notifications to resolved the notification object but that would have multiple useless instance created and more code changes that I not able to test