[Rt-devel] Problem with CF for Users

Björn Schulz bjoern.schulz at desy.de
Wed Feb 23 09:49:46 EST 2011


Hi Kevin,

Am 09.02.11 15:27, schrieb Kevin Falcone:
> On Wed, Feb 09, 2011 at 03:22:07PM +0100, Björn Schulz wrote:
>> Hi Kevin,
>>
>> Am 08.02.11 17:40, schrieb Kevin Falcone:
>>> On Tue, Feb 08, 2011 at 02:49:17PM +0100, Björn Schulz wrote:
>>>> Hi all,
>>>>
>>>> we've a problem with custom fields for users on rt 3.8.8.
>>>
>>> It is worth noting that Tickets_Overlay.pm has a LimitCustomField but
>>> Users is falling back to the generic code in RT::SearchBuilder.
>>> I suggest a ->BuildSelectQuery to confirm what the sql is doing, but
>>> if I had to guess, I'd suspect that Users isn't skipping disabled OCFV
>>> records, which means that the old value for that user is found.
>>
>> sql is doing everything right.
> 
> That appears to be custom SQL, I meant what does BuildSelectQuery spit
> out for the ticket vs the user and extra where clauses.
> 
> If I'm correct, adding an explicit Limit for FIELD => Disabled, Value
> => 0 it'll fix things.
> 
>> mysql> select Customfield, ObjectType, ObjectId, Content, Disabled from
>>  ObjectCustomFieldValues where ObjectType ='RT::User' and
>> Customfield=126  and ObjectId=1227122;
>> +-------------+------------+----------+---------+----------+
>> | Customfield | ObjectType | ObjectId | Content | Disabled |
>> +-------------+------------+----------+---------+----------+
>> |         126 | RT::User   |  1227122 | A9428   |        1 |
>> |         126 | RT::User   |  1227122 | A9488   |        0 |
>> +-------------+------------+----------+---------+----------+
>> 2 rows in set (0.00 sec)
>>
>> Do you thing this is a bug?
> 
> I'm not sure what changing Record's LimieCustomField would do to the
> rest of RT without trying it and running the test suite.

Wolfram added some line to /opt/rt3/lib/RT/SearchBuilder.pm on our 3.8.7
RT.
diff /opt/rt3/lib/RT/SearchBuilder.pm SearchBuilder.pm
262a263,268
>     $self->Limit(
> 	"ALIAS"      => $alias,
> 	"FIELD"      => 'Disabled',
> 	"OPERATOR"   => "=",
> 	"VALUE"      => 0,
>     );

It seems that it works, but how can we use the test suite to be sure
that all works fine?

Cheers,
  Björn


> 
> -kevin
> 
> 
> 
> _______________________________________________
> List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel


More information about the rt-devel mailing list