-
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
Object of class doublesecretagency\googlemaps\models\Address could not be converted to float #6
Comments
I just installed Solspace Calendar, and conducted a few basic tests... Everything seems normal from what I can tell. I'm not getting any error messages when I save an Address field in a calendar Event. An Address field is just a normal fieldtype, so it should work just fine for all Element Types, both native & 3rd-party. You may want to try nuking all of the composer files & cache. It could just be a glitchy install of one of the plugins. And if that doesn't solve it, it could even be a bug in the Calendar plugin. Make sure you're running the latest version, then maybe contact their support channel if you're still having trouble. |
Btw, feel free to DM me on Discord if you want to work through it together. 👍 |
Thanks for looking into it Lindsey. I've tracked this down further and can replicate on a fresh install - it only happens when an event is set to Repeat. I think it means it's a bug with Calendar, but might need some back and forth with you (as I don't do PHP and have no idea what might cause this). Looks like the error is specific to saving Calendar events which repeat, which contain Google Maps fields. Using the address field on it's own is fine. One-off events are fine, but as soon as I make an event recurring with an address field and try to save it, I get that error message when Craft tries to update search indexes again. Perhaps Calendar handles saving fields diferently if it's a recurring event. I've filed a bug report with Calendar referencing this issue, but are you able to reproduce with a repeating event? |
Just thought I'd check in again to see if there's anything you can do at your end about this, given that it was the migration from Smart Maps to Google Maps that caused the issue? I have a large site that I already migrated and updated, and is now missing address data all over the place while I wait to hear back from Solspace. |
Did you file an issue on the Calendars repo? It looks like they stay pretty on top of their Github issues. Probably worth starting a thread over there, since the bug is almost certainly on their end. |
Ok - no worries, thank you. I have a support ticket open with them. |
Hi @lindseydiloreto, this issue is happening because Solspace Calendar is serializing all its values when a JSON representation is requested, this means that it's going through all its custom fields and is calling the I've made a Pull Request which introduces a check for this scenario. Could you please see if that's a valid solution to this issue? |
I am having the same issue on multi-site Craft install. Error happens as soon as Craft tries to auto-save a draft and the entry is being propagated to the other sites and |
The changes made in the pull request fixes the issue for me. Thanks @gustavs-gutmanis Update: while Gustav’s fix solved the issue with saving drafts, I noticed that I had another issue. When publishing a draft the address field got cleared for some reason. I tried @lindseydiloreto suggestion #14 (comment) which resolved that issue as well. |
Thanks for the update @carlcs! Good to hear how that patch is holding up against real-world testing. I've just pushed that fix live in v4.0.3. And thanks @gustavs-gutmanis for helping track down the issue to make Calendar and Google Maps compatible! 🍺 |
Sorry this is going to be a bit vague; I can't work out exactly what's causing the issue.
I've just migrated this site from Smart Map to Google Maps. Generally went ok, but I'm seeing the same error in multiple places, basically whenever I try to interact with a Solspace Calendar event that contains an address field.
Trying to save a Solspace Calendar event that contains a Google Maps field saves the event, but it starts a task that fails immediately with the error:
Object of class doublesecretagency\googlemaps\models\Address could not be converted to float
This address field is not inside a matrix.
I previously had code working with Smart Map that combined Calendar Events with Entries, and showed the merged array on a map:
This template now also shows that same error, but doesn't tell me which line. I've tracked it down to trying to do ANYTHING with that Calendar Event model. Even if I try to
{{ dump(event) }}
it gives me that error message.Additionally, trying to output any part of the address on the Calendar Event detail page gives the same error.
Any idea where to start? The fact that it happens inside the control panel makes me think it might be Calendar/Google Maps rather than just me.
The text was updated successfully, but these errors were encountered: