From bbe5169e83dfed964f03f1ae1d8188028c107b44 Mon Sep 17 00:00:00 2001 From: Romina Suarez Date: Thu, 20 Sep 2018 14:21:53 -0300 Subject: [PATCH] $data-location has to be null otherwise the values array is not saved Fixes bug where if you sent no location but you added an image, the image was not saved --- app/Services/PlatformApiService.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Services/PlatformApiService.php b/app/Services/PlatformApiService.php index b904c38..d69a6e1 100644 --- a/app/Services/PlatformApiService.php +++ b/app/Services/PlatformApiService.php @@ -67,6 +67,8 @@ public function savePost($ongoingReport) if($attribute->label === 'location') { if(!empty($data->location) && !empty($data->location->lat) && !empty($data->location->lon)) { $data->values[$attribute->key] = [$data->location]; + } else { + $data->location = null; } } else if($attribute->label === 'image' && isset($mediaId)) { $data->values[$attribute->key]=[$mediaId];