From d1419dc89308005e1a9011e46de8221a2aa12fdc Mon Sep 17 00:00:00 2001 From: Roland Dalmulder Date: Fri, 25 Aug 2023 20:34:03 +0200 Subject: [PATCH] Fixed NPM filter Signed-off-by: Roland Dalmulder --- .../components/com_patchtester/src/Model/PullsModel.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/administrator/components/com_patchtester/src/Model/PullsModel.php b/administrator/components/com_patchtester/src/Model/PullsModel.php index e4664da..0b6143a 100644 --- a/administrator/components/com_patchtester/src/Model/PullsModel.php +++ b/administrator/components/com_patchtester/src/Model/PullsModel.php @@ -256,11 +256,10 @@ class PullsModel extends ListModel $query->where($db->quoteName('pulls.is_rtc') . ' = ' . $value); } - $npm = $this->getState()->get('filter.npm'); - if (!empty($npm)) { - // Not applied patches have a NULL value, so build our value part of the query based on this - $value = $npm === 'no' ? '0' : '1'; - $query->where($db->quoteName('pulls.is_npm') . ' = ' . $value); + $npm = $this->getState()->get('filter.npm', ''); + + if (strlen($npm) === 1) { + $query->where($db->quoteName('pulls.is_npm') . ' = ' . (int) $npm); } $draft = $this->getState()->get('filter.draft');