Mailing List Archive

[Bricolage-General] HTML::Template and One Template, No Script gives undefined reference
I created a new element of type Stories with a page subelement called
MainPage, and a Burner of HTML::Template. Then I created a template with
burner of HTML::Template simliar to the one listed in the
Bric::HTMLTemplate documentation. When I create a new story of that element
type MainPage, put some text in it, and preview, I get the following error:


Error processing Mason elements.: Can't use an undefined value as a SCALAR
reference at /usr/lib/perl5/site_perl/5.6.1/Bric/Util/Burner/Template.pm
line 982, <GEN211> line 391.
Stack Trace:
/usr/lib/perl5/site_perl/5.6.1/Bric/App/Handler.pm - 282 -
Bric::Util::Fault::new
/usr/lib/perl5/site_perl/5.6.1/Bric/App/Handler.pm - 259 -
Bric::App::Handler::handle_err
/dev/null - 0 - Bric::App::Handler::handler
/dev/null - 0 - (eval)

Looking in the module:

980 # open new file and write to it
981 open(OUT, ">$filename") or die "Unable to open $filename : $!";
982 print OUT $$header;
983 print OUT $pages[$page];
984 print OUT $$footer;
985 close(OUT);

line 982 is looking for a $$header, which is set earlier in Template.pm:

# run the category script if it exists
if ($self->_find_file('category', '.pl') or
$self->_find_file('category', '.tmpl')) {
my $category_output = $self->run_script('category', '.pl');
if (defined $category_output) {
# get header and footer and save them for _write_pages
my ($header, $footer) = split(/${\CONTENT}/, $category_output, 2);
$self->_set([qw(_header _footer)], [\$header, \$footer]);
}
}


So my question is, where is the header, or if it isn't defined should it be
set to empty string? I'm not sure where the header is being pulled from,
but since it is missing, I'm assuming (defined $category_output) is false.
So what do I change to get a header, or should this have an:

if (defined $category_output) {

} else {
my ($header, $footer) = ('','');
$self->_set([qw(_header _footer)], [\$header, \$footer]);
}

Thanks-

David

----------
David H. Bluestein II President & Lead Developer
dbii@interaction.net ii, inc.

http://www.interaction.net
- Specializing in Designing Interactive Websites -
- and Searchable Internet Databases -







-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Bricolage-General mailing list
Bricolage-General@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bricolage-general