-
Notifications
You must be signed in to change notification settings - Fork 10
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
Fixed a fatal error that happens when trying to normalize an AddressM… #14
Fixed a fatal error that happens when trying to normalize an AddressM… #14
Conversation
…odel value. This happens when Solspace Calendar is serializing an event to JSON and all the custom field values are being normalized.
Thanks @gustavs-gutmanis! It looks like this works (doesn't break anything). I may need to tweak it slightly once I understand it better. Would you mind explaining a little more about what exactly this patch is doing, and why it is necessary? I don't like adding code that I don't fully understand, I'm sure you understand. 🙂 |
I saw your comment on the related thread...
... but would still appreciate some additional clarification. Thanks! |
The issue that's happening stems from your |
Fantastic, thanks @gustavs-gutmanis! That largely clears things up. So when we've got a Then I guess the question becomes, what does Calendar want it to be? What is the JSON-ified data being used for? Would it make sense for us to be using the string-ified Address in this situation? |
After doing a bit more research, I believe my previous comment was incorrect. I think I've traced it back to a bug in my code. Under these conditions, we are accidentally trying to convert an Address Model to a Instead of the snippet you submitted, I just tried this modification... // If the value is already an Address model, return it immediately
if ($value instanceof AddressModel) {
return $value;
} And that seemed to work. You can even move those lines up to the top of the I've submitted this fix to Daryl for him to test. If that patch works for him, then I'll push out a release with that fix. 👍 |
Sorry for the delay following up... Daryl has confirmed that my fix works as intended. 👍 I've pushed the fix live in v4.0.3, please update to the latest version when you get a chance. |
This happens when Solspace Calendar is serializing an event to JSON and all the custom field values are being normalized.
Referencing issue #6