[rt-devel] Problems with rt2-to-rt3 v1.20

Stephen Quinney stephen.quinney at computing-services.oxford.ac.uk
Wed Aug 13 09:58:51 EDT 2003


On Wed, Aug 13, 2003 at 10:11:17AM +0100, Stephen Quinney wrote:
> Hi there,
> 
> I am having trouble with the rt2 to rt3 conversion scripts. The
> rt2-to-dumpfile scripts seems to work fine and I have what looks like
> a correct dumpfile. When I run dumpfile-to-rt3, it says:
> 
> "Importing users
> u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u."
> 
> but looking at the database logs while it is doing this shows nothing
> is actually succeeding:
> 
> ERROR:  pg_atoi: error in " "fake address" <fake at example.org>": 
> can't parse " "fake address" <fake at example.org>"

Ok, after investigation it seems this error is ignorable. The problem
is that the subroutine load_user() first tries to load the user with
the user_id considered as the email address, then considered as the
name and then finally the id (which is an integer). A change of the
if{} statement in load_user() to only try the id field when the user_id
is numeric gets rid of the annoying error messages.

Stephen

The patch for the small change I made is:

--- dumpfile-to-rt-3.0.orig     Wed Aug 13 14:56:24 2003
+++ dumpfile-to-rt-3.0  Wed Aug 13 14:55:45 2003
@@ -448,13 +448,13 @@
     }
     else {
         $user_objects{$user_id} = RT::User->new($RT::SystemUser);
-        if ( $user_id =~ /@/ ) {
+        if ( $user_id =~ /^\d+$/ ) {
+            $user_objects{$user_id}->LoadByCols( id => $user_id );
+        }
+       elsif ( $user_id =~ /@/ ) {
             $user_objects{$user_id}->LoadByCols( EmailAddress => $user_id );
             unless ( $user_objects{$user_id}->id ) {
                 $user_objects{$user_id}->LoadByCols( Name => $user_id );
-            }
-            unless ( $user_objects{$user_id}->id ) {
-                $user_objects{$user_id}->LoadByCols( id => $user_id );
             }
         }
         else {




More information about the Rt-devel mailing list