Skip to content

Fix/empty attributes#1776

Merged
glennjacobs merged 5 commits intolunarphp:1.xfrom
wychoong:fix/empty-attributes
May 28, 2024
Merged

Fix/empty attributes#1776
glennjacobs merged 5 commits intolunarphp:1.xfrom
wychoong:fix/empty-attributes

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

@vercel
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
@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