[Rt-commit] rt 01/01: Don't mark fields in JOIN conditions as limited

sunnavy sunnavy at bestpractical.com
Thu Jul 29 17:42:41 UTC 2021


This is an automated email from the git hooks/post-receive script.

sunnavy pushed a commit to branch 4.4/ticket-search-unread-messages
in repository rt.

commit 4d07240cba3dd27782b354e98820dbff88991dac
Author: sunnavy <sunnavy at bestpractical.com>
AuthorDate: Fri Jul 30 01:00:26 2021 +0800

    Don't mark fields in JOIN conditions as limited
    
    As we limit Transactions.Type in _HasUnreadMessagesLimit, without this
    change, "Type" would be marked as explicitly limited and the default
    implicit limit "Type = 'ticket'" wouldn't be applied.
---
 lib/RT/Tickets.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/RT/Tickets.pm b/lib/RT/Tickets.pm
index 680ada227c..76df608e20 100644
--- a/lib/RT/Tickets.pm
+++ b/lib/RT/Tickets.pm
@@ -1825,7 +1825,7 @@ sub Limit {
         if $self->{parsing_ticketsql} and not $args{LEFTJOIN};
 
     $self->{_sql_looking_at}{ lc $args{FIELD} } = 1
-        if $args{FIELD} and (not $args{ALIAS} or $args{ALIAS} eq "main");
+        if $args{FIELD} and (not $args{ALIAS} or $args{ALIAS} eq "main") and not $args{LEFTJOIN};
 
     $self->SUPER::Limit(%args);
 }

-- 
To stop receiving notification emails like this one, please contact
sysadmin at bestpractical.com.


More information about the rt-commit mailing list