X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FTicketSystem%2FRT_External.pm;h=9f07732c71ee13ac8a258a2a91562a81a3294679;hb=a582fcff5237e93aa3d61fc639c4c766e877ccac;hp=c2aac2db7229e325f67baf20c1745cb16fd4d98c;hpb=a6fe07e49e3fc12169e801b1ed6874c3a5bd8500;p=freeside.git diff --git a/FS/FS/TicketSystem/RT_External.pm b/FS/FS/TicketSystem/RT_External.pm index c2aac2db7..9f07732c7 100644 --- a/FS/FS/TicketSystem/RT_External.pm +++ b/FS/FS/TicketSystem/RT_External.pm @@ -175,12 +175,11 @@ sub _from_customer { } else { - $where = - "AND 0 = ( SELECT COUNT(*) FROM ObjectCustomFieldValues - WHERE ObjectId = Tickets.id - AND ObjectType = 'RT::Ticket' - AND $customfield_sql - ) + $where = " AND NOT EXISTS ( SELECT 1 FROM ObjectCustomFieldValues + WHERE ObjectId = Tickets.id + AND ObjectType = 'RT::Ticket' + AND $customfield_sql + ) "; }