[rt-users] Search custom field values on rt 3.6.0pre1

Joshua Colson jcolson at voidgate.org
Tue May 9 17:32:46 EDT 2006


This question was posted on April 21st by Rangarajan (See:
http://www.gossamer-threads.com/lists/rt/devel/55324#55324) without an
answer as far as I could tell. However, I've found that I'm experiencing
the same problem.

I'm running RT 3.6.0pre1 / sqlite / standalone_httpd

I have a ticket custom field called 'Registrar-Lock' that is a select
one (Options are 'Yes' or 'No'). This custom field is applied to a
Single queue ('Domains'). When I attempt to search for the tickets with
that have a value of 'Yes' (or any other value for that matter), I get
zero results.  I turned on logging of SQL statements and got the
following:



------------------------------------------------------------------------
[Tue May  9 21:03:11 2006] [error]: SQL(0.00s): SELECT  * FROM Users
WHERE id = ?;  [ bound values: '22' ] (/opt/rt3/html/autohandler:307)
[Tue May  9 21:03:11 2006] [error]: SQL(0.00s): SELECT  * FROM Groups
WHERE lower(Domain) = ? AND lower(Type) = ?;  [ bound values:
'systeminternal' 'privileged' ] (/opt/rt3/html/autohandler:307)
[Tue May  9 21:03:11 2006] [error]: SQL(0.00s): SELECT  * FROM
Principals WHERE lower(PrincipalType) = ? AND ObjectId = ?;  [ bound
values: 'user' '22' ] (/opt/rt3/html/autohandler:307)
[Tue May  9 21:03:11 2006] [error]: SQL(0.00s): SELECT  * FROM
GroupMembers WHERE GroupId = ? AND MemberId = ?;  [ bound values: '4'
'22' ] (/opt/rt3/html/autohandler:307)
[Tue May  9 21:03:11 2006] [error]: SQL(0.00s): SELECT  * FROM
Attributes WHERE lower(Name) = ? AND lower(ObjectType) = ? AND ObjectId
= ?;  [ bound values: 'pref-searchdisplay' 'rt::user' '22' ]
(/opt/rt3/html/autohandler:307)
[Tue May  9 21:03:11 2006] [error]: SQL(0.00s): SELECT  * FROM Queues
WHERE lower(Name) = ?;  [ bound values: 'domains' ]
(/opt/rt3/html/autohandler:307)
[Tue May  9 21:03:11 2006] [error]: SQL(0.00s): SELECT count(*) FROM
(SELECT DISTINCT main.id FROM Tickets main  LEFT JOIN ObjectCustomFields
ObjectCustomFields_1  ON ((ObjectCustomFields_1.ObjectId = '0')) AND(
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 = 'Registrar-Lock')) AND ((main.EffectiveId =
main.id)) AND ((main.Status != 'deleted')) AND ((main.Type = 'ticket'))
AND ((main.Queue = '3')AND ( (main.Status = 'open')OR(main.Status =
'new')OR(main.Status = 'stalled') ) AND
( (ObjectCustomFieldValues_3.Content = 'Yes') ) )  );
(/opt/rt3/html/autohandler:307)
[Tue May  9 21:03:11 2006] [error]: SQL(0.00s): SELECT ACL.id from ACL,
Groups, Principals, CachedGroupMembers WHERE  (ACL.RightName =
'SuperUser' OR  ACL.RightName = 'ModifySelf') AND Principals.Disabled =
0 AND CachedGroupMembers.Disabled = 0 AND Principals.id = Groups.id AND
Principals.PrincipalType = 'Group' AND Principals.id =
CachedGroupMembers.GroupId AND CachedGroupMembers.MemberId = 22 AND
((ACL.ObjectType = 'RT::System' AND ACL.ObjectId = 1) OR (ACL.ObjectType
= 'RT::System')) AND ACL.PrincipalId = Principals.id AND
ACL.PrincipalType = 'Group'  LIMIT 1; (/opt/rt3/html/autohandler:307)
[Tue May  9 21:03:11 2006] [error]: SQL(0.00s): SELECT ACL.id from ACL,
Groups, Principals, CachedGroupMembers WHERE  (ACL.RightName =
'SuperUser' OR  ACL.RightName = 'ShowConfigTab') AND Principals.Disabled
= 0 AND CachedGroupMembers.Disabled = 0 AND Principals.id = Groups.id
AND Principals.PrincipalType = 'Group' AND Principals.id =
CachedGroupMembers.GroupId AND CachedGroupMembers.MemberId = 22 AND
((ACL.ObjectType = 'RT::System' AND ACL.ObjectId = 1) OR (ACL.ObjectType
= 'RT::System')) AND ACL.PrincipalId = Principals.id AND
ACL.PrincipalType = 'Group'  LIMIT 1; (/opt/rt3/html/autohandler:307)
[Tue May  9 21:03:11 2006] [error]: SQL(0.00s): SELECT count(*) FROM
(SELECT DISTINCT main.id FROM Tickets main  LEFT JOIN ObjectCustomFields
ObjectCustomFields_1  ON ((ObjectCustomFields_1.ObjectId = '0')) AND(
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 = 'Registrar-Lock')) AND ((main.EffectiveId =
main.id)) AND ((main.Status != 'deleted')) AND ((main.Type = 'ticket'))
AND ((main.Queue = '3')AND ( (main.Status = 'open')OR(main.Status =
'new')OR(main.Status = 'stalled') ) AND
( (ObjectCustomFieldValues_3.Content = 'Yes') ) )  );
(/opt/rt3/html/autohandler:307)
[Tue May  9 21:03:11 2006] [error]: SQL(0.00s): SELECT DISTINCT main.*
FROM Tickets main  LEFT JOIN ObjectCustomFields ObjectCustomFields_1  ON
((ObjectCustomFields_1.ObjectId = '0')) AND(
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 = 'Registrar-Lock')) AND ((main.EffectiveId =
main.id)) AND ((main.Status != 'deleted')) AND ((main.Type = 'ticket'))
AND ((main.Queue = '3')AND ( (main.Status = 'open')OR(main.Status =
'new')OR(main.Status = 'stalled') ) AND
( (ObjectCustomFieldValues_3.Content = 'Yes') ) )  ORDER BY main.id ASC
LIMIT 50; (/opt/rt3/html/autohandler:307)




More information about the rt-users mailing list