diff --git a/app/Http/Controllers/SelfUpdateController.php b/app/Http/Controllers/SelfUpdateController.php index 1ecc2ae675ba..7daf38feed40 100644 --- a/app/Http/Controllers/SelfUpdateController.php +++ b/app/Http/Controllers/SelfUpdateController.php @@ -66,10 +66,16 @@ class SelfUpdateController extends BaseController $repo = new GitRepository(base_path()); nlog('Are there changes to pull? '.$repo->hasChanges()); + $output = ''; try { - $res = $repo->pull(); + // $res = $repo->pull(); + + $output = $repo->execute('pull origin'); + } catch (GitException $e) { + + nlog($output); nlog($e->getMessage()); return response()->json(['message'=>$e->getMessage()], 500); } @@ -78,7 +84,7 @@ class SelfUpdateController extends BaseController Artisan::call('ninja:post-update'); }); - return response()->json(['message' => ''], 200); + return response()->json(['message' => $output], 200); } public function checkVersion() diff --git a/app/Utils/HtmlEngine.php b/app/Utils/HtmlEngine.php index 60d56574750c..ff4ceaa17eba 100644 --- a/app/Utils/HtmlEngine.php +++ b/app/Utils/HtmlEngine.php @@ -260,7 +260,7 @@ class HtmlEngine $data['$contact.email'] = ['value' => $this->contact->email, 'label' => ctrans('texts.email')]; $data['$contact.phone'] = ['value' => $this->contact->phone, 'label' => ctrans('texts.phone')]; - $data['$contact.name'] = ['value' => isset($this->contact) ? $this->contact->present()->name() : 'no contact name on record', 'label' => ctrans('texts.contact_name')]; + $data['$contact.name'] = ['value' => isset($this->contact) ? $this->contact->present()->name() : $this->client->present()->name(), 'label' => ctrans('texts.contact_name')]; $data['$contact.first_name'] = ['value' => isset($this->contact) ? $this->contact->first_name : '', 'label' => ctrans('texts.first_name')]; $data['$contact.last_name'] = ['value' => isset($this->contact) ? $this->contact->last_name : '', 'label' => ctrans('texts.last_name')];