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

Error handling on workflow without status #10

Open
HeartlandTechie opened this issue Oct 7, 2022 · 4 comments
Open

Error handling on workflow without status #10

HeartlandTechie opened this issue Oct 7, 2022 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@HeartlandTechie
Copy link

Attempt to read property "status" on null at /var/www/wbl/vendor/heloufir/filament-workflow-manager/src/Core/WorkflowResource.php

I believe this occurs when you add the package to an existing table with models without a status. If the status doesn't exist, it should be created using the first status for the workflow rather than an error.

@SlavaSt295
Copy link

i guess you miss this part of the instruction https://github.com/heloufir/filament-workflow-manager/blob/master/QUICKSTART.md#permissions

@HeartlandTechie
Copy link
Author

Looking at the code sample you just shared elsewhere, you are actually running into the same problem - if the model isn't created with the workflow already attached, it's null and that blows up the code. I think there should be a sanity check to make the workflow default to whatever the first status is if there isn't a record for that model - instead it grabs nothing and gives the error on the null pluck.

@aleksanm
Copy link

aleksanm commented Jan 1, 2023

Yes. It's true for me too, on existing models, there is no status and all breaks.

@heloufir heloufir self-assigned this Jan 3, 2023
@heloufir heloufir added the bug Something isn't working label Jan 3, 2023
@heloufir
Copy link
Owner

heloufir commented Jan 3, 2023

Hello,
I will try to check this ASAP and let u know, sorry for the late answer.

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

4 participants