[rt-users] Setting owner with _Set breaks queries (may be a bug)

Thomas Sibley trs at bestpractical.com
Thu Oct 4 12:49:32 EDT 2012


On 10/04/2012 04:05 AM, Scotto Alberto wrote:
> I think I found a bug.

Not a bug in RT, only your scrip. :)

> Looks like _Set doesn’t update correctly some field in some table in the
> DB. But I have no idea of what field and what table! I had a quick look
> at the DB, and it seems that the relation ticket-owner is based on an
> user ID, not a string (the real name).

Using _Set to change the Owner is incorrect as it only updates the Owner
column in the Tickets table.  It doesn't also update the Owner role
group for the ticket.  SetOwner does both.

In general you shouldn't be calling private methods (starting with an
underscore) from code you write, for reasons just like this.

rt-validator may be able to fix your existing tickets, but I haven't
checked so I'm not certain.

http://bestpractical.com/rt/docs/latest/rt-validator.html



More information about the rt-users mailing list