From 32f965b64e19e3ecf1016edab103e5779c2b38c5 Mon Sep 17 00:00:00 2001 From: CirnoT <1447794+CirnoT@users.noreply.github.com> Date: Fri, 19 Apr 2019 10:47:32 +0200 Subject: [PATCH] fix call to shortDisplayName on null in MuninPluginController MuninPluginController did not ask for device_id in baseQuery, hence later it was impossible to construct valid Device model causing subsequent call to shortDisplayName in formatItem to be on NULL. --- app/Http/Controllers/Select/MuninPluginController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Select/MuninPluginController.php b/app/Http/Controllers/Select/MuninPluginController.php index 260bd4e57011..4ca28287d5aa 100644 --- a/app/Http/Controllers/Select/MuninPluginController.php +++ b/app/Http/Controllers/Select/MuninPluginController.php @@ -42,7 +42,7 @@ protected function baseQuery($request) ->with(['device' => function ($query) { $query->select('device_id', 'hostname', 'sysName'); }]) - ->select('mplug_id', 'mplug_type'); + ->select('mplug_id', 'mplug_type', 'device_id'); } public function formatItem($munin_plugin)