mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 23:45:10 +00:00
Fix bad location storage.
This commit is contained in:
@@ -347,6 +347,7 @@ class Request extends FormRequest
|
|||||||
$longitudeKey = null === $prefix ? 'longitude' : sprintf('%s_longitude', $prefix);
|
$longitudeKey = null === $prefix ? 'longitude' : sprintf('%s_longitude', $prefix);
|
||||||
$latitudeKey = null === $prefix ? 'latitude' : sprintf('%s_latitude', $prefix);
|
$latitudeKey = null === $prefix ? 'latitude' : sprintf('%s_latitude', $prefix);
|
||||||
$zoomLevelKey = null === $prefix ? 'zoom_level' : sprintf('%s_zoom_level', $prefix);
|
$zoomLevelKey = null === $prefix ? 'zoom_level' : sprintf('%s_zoom_level', $prefix);
|
||||||
|
$hasLocationKey = null === $prefix ? 'has_location' : sprintf('%s_has_location', $prefix);
|
||||||
|
|
||||||
// for a POST (store, all fields must be present and accounted for:
|
// for a POST (store, all fields must be present and accounted for:
|
||||||
if (
|
if (
|
||||||
@@ -354,7 +355,8 @@ class Request extends FormRequest
|
|||||||
&& ($this->has($longitudeKey) && $this->has($latitudeKey) && $this->has($zoomLevelKey))
|
&& ($this->has($longitudeKey) && $this->has($latitudeKey) && $this->has($zoomLevelKey))
|
||||||
) {
|
) {
|
||||||
Log::debug('Method is POST and all fields present.');
|
Log::debug('Method is POST and all fields present.');
|
||||||
$data['store_location'] = true;
|
|
||||||
|
$data['store_location'] = $this->boolean($hasLocationKey);
|
||||||
$data['longitude'] = '' === $this->string($longitudeKey) ? null : $this->string($longitudeKey);
|
$data['longitude'] = '' === $this->string($longitudeKey) ? null : $this->string($longitudeKey);
|
||||||
$data['latitude'] = '' === $this->string($latitudeKey) ? null : $this->string($latitudeKey);
|
$data['latitude'] = '' === $this->string($latitudeKey) ? null : $this->string($latitudeKey);
|
||||||
$data['zoom_level'] = '' === $this->string($zoomLevelKey) ? null : $this->integer($zoomLevelKey);
|
$data['zoom_level'] = '' === $this->string($zoomLevelKey) ? null : $this->integer($zoomLevelKey);
|
||||||
|
@@ -86,6 +86,7 @@
|
|||||||
console.log('Set object location: lat(' + e.latlng.lat + '), long(' + e.latlng.lng + '), zoom (' + mymap.getZoom() + ')');
|
console.log('Set object location: lat(' + e.latlng.lat + '), long(' + e.latlng.lng + '), zoom (' + mymap.getZoom() + ')');
|
||||||
$('input[name="{{ latitudevar }}"]').val(e.latlng.lat);
|
$('input[name="{{ latitudevar }}"]').val(e.latlng.lat);
|
||||||
$('input[name="{{ longitudevar }}"]').val(e.latlng.lng);
|
$('input[name="{{ longitudevar }}"]').val(e.latlng.lng);
|
||||||
|
$('input[name="{{ haslocationvar }}"]').val('true');
|
||||||
}
|
}
|
||||||
if (typeof e.latlng === 'undefined') {
|
if (typeof e.latlng === 'undefined') {
|
||||||
console.log('Set object zoom level to ' + mymap.getZoom());
|
console.log('Set object zoom level to ' + mymap.getZoom());
|
||||||
|
Reference in New Issue
Block a user