[rt-devel] error by loading an queue

Ruslan U. Zakirov cubic at acronis.ru
Fri Jan 23 08:01:46 EST 2004


Tina Schade wrote:
> Hello,
> 
> I want to load a queue from the database, but it doesn´t work. Can someone 
> help me please. I started to lern perl for 2 weeks....
> 
My template for CL perl scripts:

#!/usr/bin/perl

use strict;
use lib '/opt/rt3/lib';
use lib '/opt/rt3/etc';

use RT;

#Load RT's config file
RT::LoadConfig();
# Connect to the database. set up loggign
RT::Init();

use RT::...


> my code:
> #! /usr/bin/perl -w
> 
> use strict;
> # bindet Modul RT::Queue ein und ist Kind der Klasse RT::SearchBuilder
> use RT::Queues;
> #use RT::ACL;
> 
> $RT::SystemUser = 1; # entspricht der Id des RT_System
> # I think this is not ok, because $RT::SystemUser is defined in System.pm as 
> an object, isn´t it?
RT::Init() do it for you.
Don't do this.
> 
> # next I want to make a new instance of queue - its empty
> my $queue = RT::Queue->new($RT::SystemUser); # neues Objekt Queues anlegen
> #my $queue = new RT::Queue($root); # neues Objekt Queues anlegen
> print( "neues leeres Objekt $queue angelegt. \n" );
> 
> # now I will load a queue from the database by id
> my $queueLoad = $queue->Load(3); # Stapel mit id= 3 => Bugs laden
> print( "jetzt muesste in $queue was drin stehen und der Name ist: $queue->{ 
> 'Name' } \n" );
> 
> exit(0);
> 
> the error:
> Can't call method "CaseSensitive" on an undefined value at 
> /opt/rt3/lib//RT/Record.pm line 200
You've skipped RT init state -> config not loaded -> you havn't got 
connect to db -> object which represent connect is missed.
> 
> 
> thanks,
> Tina

			Best regargds. Ruslan.
				Good luck with Perl magic %)





More information about the Rt-devel mailing list