On Thu, 7 Jun 2007, Matt Rolf wrote:
>> not in a template, so $m isn't a global variable.
>> $m is an HTML::Mason thing, available inside
templates.
[...]
> Well, the file /lib/Bric/App/Authz.pm makes a call for
the error templates on
> line 163.
>
> $HTML::Mason::Commands::m->comp('/errors/403.mc',
> perm =>
$chk_perm,
> obj => $obj);
Ah okay, right.
> So in Burner.pm, I'm trying to use
>
> package HTML::Mason::Commands qw(m);
> use HTML::Mason::Commands::m;
Wow, no.
Package declarations don't have a list of options after
them,
so you don't put qw(m) there. You're just stating which
package the following code belongs in, that's all. You
don't
even want to have that.
$HTML::Mason::Commands::m is a package variable, not a
package,
so you don't `use' it. Normally you just refer to it with
$m;
adding the HTML::Mason::Commands explicitly says which $m
you're referring to.
> Followed by
>
> $HTML::Mason::Commands::m->comp(
'/related_list_print.mc' );
>
> Later in the file.
>
> However, I'm getting this error in the bric_queued
log:
bric_queued isn't running inside the Bricolage web
application.
It's a daemon running on its own. So it's not handling
webpage
requests itself, right, so it's not using
mod_perl/HTML::Mason
for running the application; it's not a web application
context.
(How do things get published, then?
lib/Bric/Util/Burner/Mason.pm
sets up Mason interpreters itself to burn the templates!)
The thing above from Authz (in chk_authz) is presumably
only ever called from parts of Bricolage where it's being
run
within a mod_perl/HTML::Mason web application,
so this $m would be set up then.
What is the template '/related_list_print.mc'? Does it
really
have to be a template? I'm confused about what exactly
that's
doing. If it's just some Perl code, you could put it right
there where you're trying to call the template. I don't
really
understand what it would be trying to output, as a
*template*.
|