[Rt-devel] A different customfield search bug

Jesse Vincent jesse at bestpractical.com
Tue Feb 14 11:15:15 EST 2006




On Tue, Feb 14, 2006 at 08:25:45AM -0500, Ben Goodwin wrote:
> I've been following the SVN repo for some time now and a few weeks ago a 
> user of mine reported she was unable to search data in a custom field.  
> Indeed, (global) customfield searching is completely broken (I just svn 
> update'd and it's still broken).  The attached code.txt returns no rows, 
> though I guarantee there are thousands of matches.  The resulting MySQL 
> query is attached as well.

What release of RT?

> 
> It's looking like the  (ObjectCustomFields_1.ObjectId = main.Queue) is 
> problematic for global custom fields as the ObjectId is 0 in this case.  
> Indeed, if I search for data in a customfield that's attached to a 
> specific queue, it works well.
> 
> Thoughts?
> 
>    -=| Ben
> 

> SELECT DISTINCT main.* FROM (((Tickets main  LEFT JOIN ObjectCustomFields ObjectCustomFields_1  ON ( ObjectCustomFields_1.ObjectId = main.Queue))  LEFT JOIN CustomFields CustomFields_2  ON ( CustomFields_2.id = ObjectCustomFields_1.CustomField))  LEFT JOIN ObjectCustomFieldValues ObjectCustomFieldValues_3  ON ((ObjectCustomFieldValues_3.ObjectId = main.id)) AND(  ObjectCustomFieldValues_3.CustomField = CustomFields_2.id) AND( (ObjectCustomFieldValues_3.Disabled = '0')) AND( (ObjectCustomFieldValues_3.ObjectType = 'RT::Ticket')))   WHERE ((CustomFields_2.name = 'Customer')) AND ((main.EffectiveId = main.id)) AND ((main.Status != 'deleted')) AND ((main.Type = 'ticket')) AND ( ( (ObjectCustomFieldValues_3.Content = 'PHS') ) )
> my $tickets = new RT::Tickets($RT::SystemUser);
> $tickets->FromSQL ( q[CF.{Customer} = "PHS"] );
> 
> while (my $Ticket = $tickets->Next) {
>         print $Ticket->id . " " . $Ticket->Subject . "\n";
> }
> _______________________________________________
> Rt-devel mailing list
> Rt-devel at lists.bestpractical.com
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel


-- 


More information about the Rt-devel mailing list