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

Crash Index page with filtered data after reload #1486

Closed
yepbro opened this issue Jan 19, 2025 · 4 comments
Closed

Crash Index page with filtered data after reload #1486

yepbro opened this issue Jan 19, 2025 · 4 comments

Comments

@yepbro
Copy link

yepbro commented Jan 19, 2025

MoonShine Version

3.3.2

Laravel Version

11.38.2

PHP Version

8.4.2

Database Driver & Version

No response

Description

A page crashed after reloading the index resources page if the filter contains multiple values per item and identical model properties only accept one value.

Steps To Reproduce

  1. Create a model where field has Enum cast
  2. Add this field to the filter with the Enum filed
  3. Apply filter
  4. Refresh the page
@lee-to
Copy link
Collaborator

lee-to commented Jan 20, 2025

Спасибо за issue, немного переделал наполнение и избавился от лишнего запроса, все благодаря вам

@lee-to lee-to closed this as completed Jan 20, 2025
@lee-to
Copy link
Collaborator

lee-to commented Jan 23, 2025

@lee-to Ошибка осталась. Она же происходит в момент заполнения модели для которой сделан ресурс данными переданными из фильтра.

И так как у одного из параметров фильтра есть опция multiple, то в модель передается массив со всеми выбранными значениями. А поле модели может принять только одно значение (string|int).

Modules\\UpdateLoggerBot\\Enums\\ChatType::from(): Argument #1 ($value) must be of type string|int, array given

Image

Блин! Спасибо что написали! Мой апдейт не был доставлен в релиз, сейчас исправлю

@lee-to
Copy link
Collaborator

lee-to commented Jan 23, 2025

@pulpirzvk сделал релиз, суть фикса в том что я исплючаю все кроме данных отношений из наполнения

@yepbro
Copy link
Author

yepbro commented Jan 23, 2025

Все работает! Спасибо :)

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