From 01afb3a2bafe5109c98beab79a2978b288532c2e Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Fri, 21 Jun 2024 13:29:36 +0200 Subject: [PATCH] ObjectSuggestions: Consider `deleted` column for value suggestions --- .../Web/Control/SearchBar/ObjectSuggestions.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/library/Notifications/Web/Control/SearchBar/ObjectSuggestions.php b/library/Notifications/Web/Control/SearchBar/ObjectSuggestions.php index 6ca9b208c..f6e4041f2 100644 --- a/library/Notifications/Web/Control/SearchBar/ObjectSuggestions.php +++ b/library/Notifications/Web/Control/SearchBar/ObjectSuggestions.php @@ -99,8 +99,12 @@ protected function createQuickSearchFilter($searchTerm) protected function fetchValueSuggestions($column, $searchTerm, Filter\Chain $searchFilter) { $model = $this->getModel(); - $query = $model::on(Database::get()); - $query->limit(static::DEFAULT_LIMIT); + $query = $model::on(Database::get()) + ->limit(static::DEFAULT_LIMIT); + + if (in_array('deleted', $model->getColumns())) { + $query->filter(Filter::equal('deleted', 'n')); + } if (strpos($column, ' ') !== false) { // $column may be a label