-
Notifications
You must be signed in to change notification settings - Fork 7
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
PHP TypeError trim in Geofield proximity view #51
Comments
Some more observations: As far as I know, the error happens with PHP 8.2 but not with PHP 8.1. Also, there is a workaround: Add a 'Geofield:lat (not empty)' filter to the view. Finally, the issue seems to be fixed when I change line 234 in
to:
(I found a file with this patch in an older test site. Unfortunately, I don't recall from where I got it.) |
Some more digging: I never saw that error, but my setup is different: no Address field, not using Google API, no automatic geocoding from field. (Still PHP 8.2) Hope this helps to narrow things down a bit. |
@olafgrabienski you could do a little more debugging, I guess. When the field value's empty, Can you put in a:
right before that breaking line and check what the value is? Either directly on page (when error display's on), or in dblog if not. Not on a production site, of course. |
Thanks for your feedback, @indigoxela! Interestingly, I'm not able to reproduce the error at the moment, even though I have removed both the patch and the 'Geofield:lat (not empty)' views filter (and cleared caches several times). Hm ..., when I tested this some months ago, I also started with this very issue and ended up with a working site, and I wasn't sure what exactly fixed it. And now again, as the issue seems to be fixed somehow, I don't know how to reproduce it. That said, I put however the debug code before the line in question, getting the following message in DBlog.
Not sure if this is still relevant, though. |
In this case the first condition works, so you don't even get to the "trim()".
A Heisenbug - they're the worst. 🙊 Your initial report indicates, that this value can be a non-empty array under circumstances... But without steps to reproduce, I guess we're stuck ATM. 🤷 Anyway, the issue exists now and maybe someone comes up with a clue. Maybe some "hickup" when geocoding the address? Not sure. I usually avoid automatic geocoding of address fields - had all sorts of trouble with that in D7. |
When I set up a content view with Geofield data, I get the following error:
Steps to reproduce
( Note: It's not that easy to obtain a Google Maps API Key, so I hope someone running a site with similar setup can try to reproduce the issue. )
Actual behavior: The view doesn't show anything. In DBlog, you see the error message from above.
Expected behavior: The view works, and you can filter the locations by proximity.
Additional information
The text was updated successfully, but these errors were encountered: