From 3a302fe2d7ddd1da771accbcbcd92fea82aabbf9 Mon Sep 17 00:00:00 2001 From: Nicolai Essig Date: Tue, 24 Oct 2017 03:28:06 +0200 Subject: [PATCH] ref #2737 prevent assets with "rtd_location_id" null values to be removed on location sort (#4283) --- app/Models/Asset.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/Asset.php b/app/Models/Asset.php index 1ab2f41a76..c8437681e2 100644 --- a/app/Models/Asset.php +++ b/app/Models/Asset.php @@ -1060,7 +1060,7 @@ class Asset extends Depreciable */ public function scopeOrderLocation($query, $order) { - return $query->join('locations', 'locations.id', '=', 'assets.rtd_location_id')->orderBy('locations.name', $order); + return $query->leftJoin('locations', 'locations.id', '=', 'assets.rtd_location_id')->orderBy('locations.name', $order); }