Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Error running installation code...

Quote Reply
Error running installation code...
Man...whats wrong with this code? At first I thought it was the value not being passed into $html, but the debugging 'print' statements seem to show other wise. Code is;

Code:
my @files = ('cat_advert.html',
'cat_advert_admin.html',
'cat_admin_front.html');

my $html;
foreach $html (@files) {

print "File: $html <BR>";

# if templates already exist...dont get rid of em!
if (-e "$CFG->{admin_root_path}/templates/$CFG->{build_default_tpl}/$html") { next; }

$file = $tar->get_file ($html);
$file->name("$CFG->{admin_root_path}/templates/$CFG->{build_default_tpl}/$html") or return Plugins::Category_Adverts->error("Error: $GT::Tar::error");
$file->write or return Plugins::Category_Adverts->error("Unable to extract file: '$CFG->{admin_root_path}/templates/$CFG->{build_default_tpl}/$html' ($GT::Tar::error)", 'WARN');
}

The error when installing is;

Error running installation code: Can't call method "name" on an undefined value at (eval 4) line 194.

Am I going mad? What am I doing wrong? Unsure

*is glad he has short hair, so he can't pull it out easily*

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Error running installation code... In reply to
Prolly because get_file can't get your file from the tar.
Quote Reply
Re: [Andy] Error running installation code... In reply to
are the files in a subdirectory in the tar file, like /templates ?

my $file = $tar->get_file ("templates/$html");


PUGDOG´┐Ż Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Error running installation code... In reply to
Nope...all files are at root level in the tar Unsure

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Error running installation code... In reply to
If $file is empty then something is going wrong grabbing the file from the tar so you'll have to make sure the tar isn't corrput and do some debugging.
Quote Reply
Re: [Paul] Error running installation code... In reply to
What other kind of debugging can I do on the tar though? All I could think of was the printing of the files attempting to be grabbed Frown

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Error running installation code... In reply to
Try using GT::Dumper to dump $file after you've called get_file. Accoring to that routine it should show an error if the file can't be found....

Code:
if (! @files) {
return $self->error ('CANTFIND', 'WARN', $filename);
}

It is a warning, so will show in your error log so check there too.
Quote Reply
Re: [Paul] Error running installation code... In reply to
Result;

$VAR = undef;

Code:
my $file = $tar->get_file ($html);
use GT::Dumper;
print Dumper($file);

Unimpressed

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Error running installation code... In reply to
And log?
Quote Reply
Re: [Paul] Error running installation code... In reply to
Nothing recorded...last erorr logged was;

[Fri Feb 7 04:13:11 2003] [error] [client 62.64.235.193] File does not exist: /home/linkssql/public_html/401.shtml
[Fri Feb 7 00:12:35 2003] [error] [client 64.68.82.45] File does not exist: /home/linkssql/public_html/404.shtml



Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Paul] Error running installation code... In reply to
Andy, you may try out to insert this code, then Dump the $files:
my $files = $tar->files;

It will return an array ref, so you can see what was able to read.

BTW: I don't see in your code, but I suppose you used this already, right?
use GT::Tar;
my $tar = GT::Tar->open('/path/to/file.tar')

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Quote Reply
Re: [webmaster33] Error running installation code... In reply to
No need to create a new tar object in Install.pm, it's already there for you Wink
Quote Reply
Re: [Paul] Error running installation code... In reply to
Oh, really, I forgot that. Blush
Thanks!

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Quote Reply
Re: [webmaster33] Error running installation code... In reply to
Ok guys. I managed to get it working Smile Not quite sure what it was that was caugin the problem, but it seems to have gone away now.

Thanks everyone for your help Smile

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!