From d2587337e4cc4affb6bc38b2f1df3116dde01fcb Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 1 Feb 2018 16:31:32 -0600 Subject: [PATCH] Fixed #4952 - ignore show_archived setting when drilling down into specific ID --- app/Http/Controllers/Api/AssetsController.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php index 707668d6d6..ef89f948ae 100644 --- a/app/Http/Controllers/Api/AssetsController.php +++ b/app/Http/Controllers/Api/AssetsController.php @@ -199,12 +199,18 @@ class AssetsController extends Controller break; default: - if ($settings->show_archived_in_list!='1') { + if ((!$request->has('status_id')) && ($settings->show_archived_in_list!='1')) { // terrible workaround for complex-query Laravel bug in fulltext $assets->join('status_labels AS status_alias',function ($join) { $join->on('status_alias.id', "=", "assets.status_id") ->where('status_alias.archived', '=', 0); }); + + // If there is a status ID, don't take show_archived_in_list into consideration + } else { + $assets->join('status_labels AS status_alias',function ($join) { + $join->on('status_alias.id', "=", "assets.status_id"); + }); } }