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

Fix/empty attributes #1776

Merged
merged 5 commits into from
May 28, 2024
Merged

Conversation

wychoong
Copy link
Contributor

@wychoong wychoong commented May 24, 2024

Fix error get_class(): Argument #1 ($object) must be of type object, null given

this happens when added a new attribute to a resource.
the fix 7b19a0e is to mutate the state during field dehydration to return new field type instance when state is null
formatStateUsing doesnt set the instance during field hydration as it only apply when the state is not null

other commits are some inconsistency that I found while troubleshooting, it should still works without those commits

Copy link

vercel bot commented May 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lunar-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 24, 2024 7:56am

@wychoong
Copy link
Contributor Author

related to #1772

i think ultimately its down to whether the attribute_data field should keep the field types when the value is empty

@alecritson alecritson requested a review from glennjacobs May 24, 2024 09:42
@glennjacobs glennjacobs self-assigned this May 24, 2024
@glennjacobs glennjacobs merged commit 1051897 into lunarphp:1.x May 28, 2024
22 checks passed
@wychoong wychoong deleted the fix/empty-attributes branch May 28, 2024 12:41
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

Successfully merging this pull request may close these issues.

2 participants