[Rt-devel] Limiting and SearchBuilder
Timothy Smith
tsmith at loc.gov
Fri Jul 7 16:00:02 EDT 2006
I've encountered a couple of strange-looking Limit behaviors in SearchBuilder 1.26 and I'm wondering if it's buggy or if I'm misunderstanding something.
The /Admin/Elements/SelectUsers component returns an HTML list that includes the users Nobody and RT_System, even though the code seems to be explicitly trying to avoid them:
----
my $users = new RT::Users($session{'CurrentUser'});
$users->Limit(FIELD => 'id', VALUE => $RT::SystemUser->id, OPERATOR => '!=' );
$users->Limit(FIELD => 'id', VALUE => $RT::Nobody->id, OPERATOR => '!=' );
$users->LimitToPrivileged();
----
Earlier, I was trying to reuse a CustomFieldValues object by doing something like
my $CustomFieldValues = RT::CustomFieldValues->new($system{CurrentUser});
for(my $ i = 0; $i < $magic; ++$i) {
$CustomFieldValues->UnLimit;
$CustomFieldValues->LimitByCustomField($fields[$i]);
....
}
and it didn't seem to be unlimiting correctly -- the first iteration worked great, but it didn't clear between iterations (i.e. the values in the third iteration also had the values from the first and second despite the explicit call to UnLimit).
Any thoughts?
Tim Smith
More information about the Rt-devel
mailing list