Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Sub-routine wierdness

Quote Reply
Sub-routine wierdness
I am using the sub-routine mentioned in the 'Help' files of SQL and it has the effect of making the <%grand_total%> tag an 'Unknown Tag'.

Here's the routine I've implemented:

sub {
my $vals = shift;
my $link_db = $DB->table ('Links');
$link_db->select_options ('ORDER BY Featured ASC', 'LIMIT 3');
my $sth = $link_db->select;
my $output = '';
while (my $link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display('link3', $link);
}
return $output;
}

The link3 file is a new one I made, instead of the original, and at first I thought the problem was within the link3.html, but I deleted everything from the link3.html file as a test and the error still occurred.

It's very strange, because if I move the <%grand_total%> tag above the call for the sub-routine, the grand_total works, at least when it's physically above the page from the subroutine. The one below will only work when I remove the call for the sub-routine.

Any ideas on what might be going on?

Bryan

Quote Reply
Re: Sub-routine wierdness In reply to
I'm going to have to look into this when I get back unfortuantely.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: Sub-routine wierdness In reply to
Hi,

I've tracked this down. What was happening is the call to Links::SiteHTML::display() was resetting your current template parser, losing all your existing variables.

I've fixed this up. Thanks!

Cheers,

Alex

--
Gossamer Threads Inc.