From 1f5694c142c0e3d9a62644162de8db4f1efbf85f Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Tue, 5 Nov 2013 22:05:40 +0000 Subject: [PATCH] Fix filter issue where negative logic prevents matches The quickList() method will attempt to ask the database to find filters that might match the incoming ticket information. The idea is that MySQL is likely faster than PHP. The problem is that it assumes positive logic is being utilized. This patch adds all filters with at least one rule with dn_contain (does-not-contain) or not_equal (not-equal) --- include/class.filter.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/class.filter.php b/include/class.filter.php index df351c8a7..eb865c17a 100644 --- a/include/class.filter.php +++ b/include/class.filter.php @@ -786,6 +786,9 @@ class TicketFilter { if($this->vars['subject']) $sql.=" OR (what='subject' AND LOCATE(val, ".db_input($this->vars['subject']).'))'; + # Always include negative-logic rules + $sql.=" OR how IN ('dn_contain', 'not_equal')"; + # Also include filters that do not have any rules concerning either # sender-email-addresses or sender-names or subjects -- GitLab