[rt-users] fixing attributes with a CLI script

Geoff Crompton geoffc at trinity.unimelb.edu.au
Mon May 23 01:00:37 EDT 2011


On 23/05/11 11:12, Geoff Crompton wrote:
> Hi,
>
> I'm trying to repair my searches on test RT installation that I've
> upgraded from rt3.6 to rt3.8. This problem is described on
> http://requesttracker.wikia.com/wiki/RepairSearches
>
> Rather than doing this manually, or just deleting all saved searches I'm
> trying to do this with a script. I've copied the
> /usr/sbin/rt-dump-database-3.8 as a starting point, and stripped out
> things I don't need from that script.
>
> According to my print statements the script is doing what I want, but
> the changes are not sticking to the database. I'm calling
> $attribute->SetAttribute() to update the attributes I want to change.
> Despite this after running the script the searches are still incorrect.
>
> I've been reading the RT::Record code, but I don't know what I'm doing
> wrong. I thought maybe I wasn't committing a transaction, but adding
> '$RT::Handle->BeginTransaction() and $RT::EndTransaction() didn't change
> things.
>
> Any tips on how to get these changes to make it to the database?
>

I've done some more debugging. When I call $attribute->SetAttribute() 
when I get down to DBIx::SearchBuilder::Record::__Set() the code returns 
'That is already the current value'.

It seems DBIx::SearchBuilder::Record::__Value() is returning the same 
string as the __Set() Value arg. I'm not a perl programmer, so I don't 
really know what I'm doing, or why the way I'm calling the API is breaking.

Anyone got any pointers on where to look next?

-- 
+-Geoff Crompton
+--Debian System Administrator
+---Trinity College



More information about the rt-users mailing list