[rt-devel] Re: [rt-users] Problem importing global keywords from 2.0.14 to 3.0.2pre3

Jesse Vincent jesse at bestpractical.com
Tue May 6 16:21:46 EDT 2003


Thanks very much for looking into this and getting a patch together. As
soon as I have net, I'll have a look and try to roll a new patch
release.

	-j



On Tue, May 06, 2003 at 04:14:04PM -0400, Gary Oberbrunner wrote:
> I wrote:
> >I'm having trouble converting global keywords from our 2.0.14 RT to
> >our new 3.0.2pre3.  I'm using version 11 of the rt2-to-rt3 scripts.
> 
> Sorry to reply to my own message, but I seem to have worked it out.
> Here's a patch which works on my system.  This is against rt2-to-rt3
> version 1.11.  I've no idea if this is the "right way" to do this, but 
> it did work for me.
> 
> Patch is enclosed.  Basically, it dumps global keywords as a global 
> CustomField hash instead of at top level, and the restorer script is 
> modified to accept it as a hash rather than an array.
> 
> -- Gary Oberbrunner

> --- rt-2.0-to-dumpfile.orig	2003-05-06 13:15:20.000000000 -0400
> +++ rt-2.0-to-dumpfile	2003-05-06 16:09:25.000000000 -0400
> @@ -106,12 +106,12 @@
>      foreach my $keysel ( @{ $global_ks->ItemsArrayRef } ) {
>  
>          foreach my $param ( sort keys %$global_ksacc, 'id' ) {
> -            $ds->{Global}->{ $keysel->id }->{$param} = $keysel->_Value($param)
> +            $ds->{Global}->{'CustomField'}->{ $keysel->id }->{$param} = $keysel->_Value($param)
>                if ( $keysel->_Value($param) );
>          }
>          my $descendents = $keysel->KeywordObj->Descendents;
>          foreach my $desc ( keys %{$descendents} ) {
> -            push @{ $ds->{Global}->{ $keysel->id }->{Value} },
> +            push @{ $ds->{Global}->{'CustomField'}->{ $keysel->id }->{Value} },
>                $descendents->{$desc};
>  
>          }
> --- dumpfile-to-rt-3.0.~1~	2003-05-06 14:17:26.000000000 -0400
> +++ dumpfile-to-rt-3.0	2003-05-06 16:09:12.000000000 -0400
> @@ -184,7 +184,7 @@
>                          Right  => $right->{'Name'} );
>  }
>  
> -foreach my $cf ( @{ $VAR1->{'Global'}->{'CustomField'} } ) {
> +foreach my $cf ( values %{ $VAR1->{'Global'}->{'CustomField'} } ) {
>      my $type;
>      my $cfobj = RT::CustomField->new($RT::SystemUser);
>      if ( $cf->{'Single'} ) {


-- 
http://www.bestpractical.com/rt  -- Trouble Ticketing. Free.



More information about the Rt-devel mailing list