Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Cant parse template

Quote Reply
Cant parse template
Hi,
When trying to validate some links, I got the following error:

Can't parse template. Reason: at Links/DB_Utils.pm line 213.

ANy idea?

Thanks,
Emilio
Quote Reply
Re: Cant parse template In reply to
I changed the lines you told me, and got a HASH errror at Template.pm line 92

I got this message when trying to "validate links", "search.cgi" and "search-ni.cgi" so I changed it back as it was.

I have CGI.pm 2.56

Thanks,
Emilio

BTW, Alex, did you get my email regarding a custom cgi?


Quote Reply
Re: Cant parse template In reply to
Do your templates exist? I got that sort of error when I had changed some paths, and didn't move all the templates over.

I've messed around with my DBSQL.pm a bit, so I don't know what your line number is... but if it's a &load_template call, that's probably the problem.
Quote Reply
Re: Cant parse template In reply to
Hmm, if you edit DB_Utils.pm, around line 210 and change:

$TEMPLATE->load_template ($tpl, $string) or die ("Can't load template. Reason: $Template::error");
$TEMPLATE->load_vars ($vars) or die ("Can't load variables. Reason: $Template::error");
my $output = $TEMPLATE->parse ($tpl) or die ("Can't parse template. Reason: $Template::error");

to:

$TEMPLATE->load_template ($tpl, $string) or die ("Can't load template. Reason: $Links::Template::error");
$TEMPLATE->load_vars ($vars) or die ("Can't load variables. Reason: $Links::Template::error");
my $output = $TEMPLATE->parse ($tpl) or die ("Can't parse template. Reason: $Links::Template::error");

It will display the real error message. I've fixed this up!

Cheers,

Alex
Quote Reply
Re: Cant parse template In reply to
Alex,

Can there be a scope problem with the hashes? It seems that this may be a problem with the external programs, (of which page.cgi would be one). Something is not initializing properly (or properly on all systems)?

Also: What about releasing a 1.1a version with all the little fixes, and let everyone upgrade. We know we pushed you for the 1.1 and knew there would be tweaks coming. There shouldn't be any template or database changes, so except for those of us who have customized the code, it would be quite painless, and bring everyone up to the same minor revision level. Those of us who have customized, the customizations should just plug right in.

I've mentioned a few times for people to comment their changes with a different sort of comment tag -- I use ##_## -- then just do a grep to see what files actually had changes, and where they are. Makes it as easy as it can be to effect changes.




Quote Reply
Re: Cant parse template In reply to
Pugdog,

Do you know if there's any other way to validate links?

Quote Reply
Re: Cant parse template In reply to
Pugdog,

Do you know if there's any other way to validate links?

Quote Reply
Re: Cant parse template In reply to
Hi,

Try adding:

$self->{'vars'} = {};

in Template.pm right after:

$self->{'ROOT'} = ${$opt}{'ROOT'};
$self->{'CHECK'} = ${$opt}{'CHECK'};

these two lines. Should be around line 62 or so. Let me know if that fixes it.

Pugdog, I hope to have one shortly (Did you have a chance to send me the zip file so I can look into the page.cgi problem)?

Cheers,

Alex
Quote Reply
Re: Cant parse template In reply to
Ooops... I lost it. I'll send it now. The site still has the same odd problem of the first days_old tag in page.cgi not showing the image. It's on the way.
Quote Reply
Re: Cant parse template In reply to
Nope Frown

I added that to template.pm adn changed the lines in db_utils.pm, and now get the following when trying to validate:

Can't parse template. Reason: at Links/DB_Utils.pm line 214.

These are my lines from 209 to 222:

}
$TEMPLATE->clear_vars;

$TEMPLATE->load_template ($tpl, $string) or die ("Can't load template. Reason: $Links::Template::error");
$TEMPLATE->load_vars ($vars) or die ("Can't load variables. Reason: $Links::Template::error");
my $output = $TEMPLATE->parse ($tpl) or die ("Can't parse template. Reason: $Links::Template::error");


(defined $old_root) and $TEMPLATE->root($old_root);

$LINKS{compress} and &compress (\$output);

return $output;
}
Quote Reply
Re: Cant parse template In reply to
Lines got scrambled... this IS line 214:

my $output = $TEMPLATE->parse ($tpl) or die ("Can't parse template. Reason: $Links::Template::error");
Quote Reply
Re: Cant parse template In reply to
You know what it might be, perhaps your template files are 0 bytes? Check your template directory and see if there are any 0 byte files.

If you are still stuck, can you send me telnet info so I can take a look?

Cheers,

Alex
Quote Reply
Re: Cant parse template In reply to
That was indeed the problem. When you validate it needs to load/parse the email-del.txt file which was 0 bytes.

I'll fix it up so that it will generate a nicer error message, in the meantime, I just put some text into email-del.txt and it's working fine.

Cheers,

Alex
Quote Reply
Re: Cant parse template In reply to
Thanks a lot ! Smile