filamentphp / filament

A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
https://filamentphp.com
MIT License
19.31k stars 2.97k forks source link

Database Notifications is not displayed correctly due to the ListPage parameter page=2 when the `$isPaginated` option is active #12342

Closed wallacemaxters closed 7 months ago

wallacemaxters commented 7 months ago

Package

filament/filament

Package Version

v3.2.65

Laravel Version

10.48.7

Livewire Version

3.4.10

PHP Version

8.2

Problem description

Database notifications do not appear when we have a page=2 parameter in the url on the ListRecord page. From what I understand, the Filament\Notifications\Livewire::getNotifications() method returns paginated results and the url parameter affects notifications, when it should only affect ListRecord results.

Expected behavior

View notifications regardless of the parameter provided in the ListPage

Steps to reproduce

1) Run the command php artisan migrate:fresh --seed 2) Login with e-mail filament@test.com and password 123456 3) Go to "Users" page 4) Click in "2" pagination 5) Refresh page 6) Open the notifications

Reproduction repository

https://github.com/wallacemaxters/filament-bug-report

Relevant log output

No response

danharrin commented 7 months ago

No reproduction repository

wallacemaxters commented 7 months ago

Please, reopen the issue. I updated the step to reproduction link

dmitry-udod commented 7 months ago

Hi all! It seems the bug exists; here is a confirmation:

https://github.com/filamentphp/filament/assets/4639175/f328f9d7-a7d6-4d5c-907d-5378c6c6d478

As a proposal to fix the bug, we could choose a different name for the GET parameter used for database notifications (I'm not sure about the param name)


return $this->getNotificationsQuery()->simplePaginate(50, pageName: 'notifications-page');