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

[Bug]: Kanban view crashes when using Model::preventAccessingMissingAttributes() #14

Closed
nsrosenqvist opened this issue Feb 24, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@nsrosenqvist
Copy link

What happened?

I can't open the kanban board without getting an exception when the view renders if I use Model::preventAccessingMissingAttributes(). The crash occurs in resources/views/kanban-record.blade.php due to calling the blade directive @if($record->just_updated) checking if just_updated exists on the model or not.

How to reproduce the bug

Model::preventAccessingMissingAttributes() is a setting that makes sure that one can't use attributes that don't exist on a model, this of course helps prevent bugs. Call the method in your AppServiceProvider.

Package Version

2.2.0

PHP Version

8.3.2-1+ubuntu22.04.1+deb.sury.org+1

Laravel Version

10.45.1

Which operating systems does with happen with?

No response

Which browsers does with happen with?

No response

Notes

The bug is easily fixed by using isset in the @if condition rather than attempting to access the property directly.

@nsrosenqvist nsrosenqvist added the bug Something isn't working label Feb 24, 2024
@mokhosh
Copy link
Owner

mokhosh commented Feb 24, 2024

makes sense, I'll fix it when i get back.

@mokhosh
Copy link
Owner

mokhosh commented Feb 25, 2024

@mokhosh mokhosh closed this as completed Feb 25, 2024
@nsrosenqvist
Copy link
Author

@mokhosh Thank you for addressing the issue so quickly! I was able to work around it by simple adding a property to the model called just_updated and setting it to false, but I really appreciate you taking a look at it right away :)

@mokhosh
Copy link
Owner

mokhosh commented Mar 2, 2024

No problem buddy 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants