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

deg2rad() expects parameter 1 to be float, string given #230

Closed
jonXmack opened this issue Dec 18, 2019 · 0 comments
Closed

deg2rad() expects parameter 1 to be float, string given #230

jonXmack opened this issue Dec 18, 2019 · 0 comments

Comments

@jonXmack
Copy link

jonXmack commented Dec 18, 2019

Description

I'm putting together a search on a site of ours which includes a location search. The user has the option to put in a postcode and distance, and the site searches events in that radius. I also have a bunch of other search parameters which can be set so I'm building an array to search by.

The code in question looks like this:

{% set queryParams = queryParams|merge({
	eventMap: {
		location: widgetEventPostcode ? widgetEventPostcode : 'KT22 7UD',
		country: 'UK',
		radius: widgetEventDistance ? widgetEventDistance : 1000,
		unit: 'mi'
	},
	orderBy: 'distance desc',
}) %}

When I put a postcode into the search form it's throwing the error deg2rad() expects parameter 1 to be float, string given which is on line 145 of MapService.php.

I understand it's a bit of an edge case and might be due to how I'm building my search query so if that's the case please let me know what I'm doing wrong.

Additional info

  • Craft version: 3.3.18.1
  • Maps version: 3.7.5
  • Geo Service: Nominatim
  • PHP version: 7.2.14
  • Database driver & version: MySQL 5.7.25
  • Other Plugins

Feed Me | 4.1.2
Guest Entries | 2.2.4
Navigation | 1.1.14.1
Redactor | 2.4.0
SEO | 3.6.2
Stamp | 2.1.0
Stripe Payments | 2.1.6
Super Table | 2.3.1
Wordsmith | 3.1.1

@Tam Tam closed this as completed in ec71b43 Dec 18, 2019
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

No branches or pull requests

1 participant