Fix devices page search & OS loading (#9752)

* Fix devices page search

* add a definition_loaded flag to prevent false positives for already loaded OS

* Fix copy paste error

* and another
This commit is contained in:
Tony Murray
2019-01-28 10:37:41 -06:00
committed by GitHub
parent 61f7046b60
commit eb59287d34
3 changed files with 12 additions and 3 deletions

View File

@@ -75,7 +75,7 @@ class DeviceController extends TableController
$query = Device::hasAccess($request->user())->with('location')->select('devices.*');
// if searching or sorting the location field, join the locations table
if ($request->get('term') || in_array('location', array_keys($request->get('sort', [])))) {
if ($request->get('searchPhrase') || in_array('location', array_keys($request->get('sort', [])))) {
$query->leftJoin('locations', 'locations.id', 'devices.location_id');
}