From db7c786dba027f3106a7891981ccd4cc947c3f86 Mon Sep 17 00:00:00 2001 From: Jason Irish Date: Mon, 10 Oct 2016 22:39:41 -0500 Subject: [PATCH] BUGFIX: storeLocator.js - pareseFloat distance Location - cast `distance` as Decimal rather than Int --- code/objects/Location.php | 2 +- thirdparty/jquery-store-locator/js/jquery.storelocator.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/objects/Location.php b/code/objects/Location.php index 0f4df49..e5b68d7 100644 --- a/code/objects/Location.php +++ b/code/objects/Location.php @@ -42,7 +42,7 @@ class Location extends DataObject implements PermissionProvider * @var array */ private static $casting = array( - 'distance' => 'Int', + 'distance' => 'Decimal(9,3)', ); /** diff --git a/thirdparty/jquery-store-locator/js/jquery.storelocator.js b/thirdparty/jquery-store-locator/js/jquery.storelocator.js index 7756bd3..5e51308 100755 --- a/thirdparty/jquery-store-locator/js/jquery.storelocator.js +++ b/thirdparty/jquery-store-locator/js/jquery.storelocator.js @@ -473,7 +473,7 @@ $.fn.storeLocator = function(options) { 'hours3': $(this).attr('hours3'), 'category': $(this).attr('category'), 'featured': $(this).attr('featured'), - 'distance': $(this).attr('distance') + 'distance': parseFloat($(this).attr('distance')) }; if(locationData['web']) locationData['web'] = locationData['web'].replace("http://",""); // Remove scheme (todo: should NOT be done)