Merge branch 'release/0.0.13.8'

This commit is contained in:
Jonny Barnes 2016-10-06 01:08:06 +01:00
commit 4770f91ebd
2 changed files with 11 additions and 5 deletions

View file

@ -4,6 +4,7 @@ namespace App\Jobs;
use Twitter; use Twitter;
use App\Note; use App\Note;
use App\Place;
use App\Contact; use App\Contact;
use Illuminate\Bus\Queueable; use Illuminate\Bus\Queueable;
use Jonnybarnes\IndieWeb\Numbers; use Jonnybarnes\IndieWeb\Numbers;
@ -51,9 +52,12 @@ class SyndicateToTwitter implements ShouldQueue
$lat = trim($location[0]); $lat = trim($location[0]);
$lng = trim($location[1]); $lng = trim($location[1]);
} }
if ($this->note->place) { if ($this->note->place_id) {
$lat = $this->note->place->location->getLat(); //we force the job to create a place model to get access
$lng = $this->note->place->location->getLng(); //to the postgis methods
$place = Place::find($this->note->place_id)
$lat = $place->location->getLat();
$lng = $place->location->getLng();
} }
if (isset($lat) && isset($lng)) { if (isset($lat) && isset($lng)) {
$tweetOpts['lat'] = $lat; $tweetOpts['lat'] = $lat;
@ -71,8 +75,7 @@ class SyndicateToTwitter implements ShouldQueue
$responseJson = Twitter::postTweet($tweetOpts); $responseJson = Twitter::postTweet($tweetOpts);
$response = json_decode($responseJson); $response = json_decode($responseJson);
$tweetId = $response->id; $this->note->tweet_id = $response->id;
$this->note->tweet_id = $tweetId;
$this->note->save(); $this->note->save();
} }

View file

@ -1,5 +1,8 @@
# Changelog # Changelog
## Version 0.0.13.8 (2016-10-06)
- Create a Place model instance in SyndicateToTwitter job to force laravel to access postgis methods
## Version 0.0.13.7 (2016-10-05) ## Version 0.0.13.7 (2016-10-05)
- Use the correct `laravel-postgis` method call during syndication - Use the correct `laravel-postgis` method call during syndication