Mailing List Archive

Error when using $burner->preview()
I'm trying to figure out if it possible to publish a story to an output channel for which the story is not assigned. I want to always output two versions of select story types, where the second is required. Basically, I don't want to go through the process of assigning the output channel to the thousands of existing stories, nor do I want users to have the ability to unassign this particular one.

In the <cleanup> section , I'm using $burner->preview(), which takes an OC ID as a fourth parameter, but getting the following error:

Can't locate object method "apache_req" via package "HTML::Mason::Request" at /usr/local/bricolage/lib/Bric/App/Util.pm line 667, <GEN1> line 1215.

It appears that the method "apache_req" is indeed not defined. However, it looks like it is in the most recent version of HTML::Mason::Request.

Here are my questions:

1) Assuming I fix this error, is it even possible to publish to an unassigned OC from a story template?
2) Can I simply update my version of HTML::Mason::Request?
3) Should I update my version of Mason, and if so, do I risk any issues as we're still using Bricolage 1.10.3?
4) Why is $burner->preview() not intended to be called from a template as the documentation states?

Thanks, as always,

Chris

--------------------------------

Chris Schults
Web Developer
PCC Natural Markets
206-547-1222 x104
chris.schults@pccsea.com
http://www.pccnaturalmarkets.com
Re: Error when using $burner->preview() [ In reply to ]
On Nov 14, 2011, at 1:56 PM, Schults, Chris wrote:

> I'm trying to figure out if it possible to publish a story to an output channel for which the story is not assigned. I want to always output two versions of select story types, where the second is required. Basically, I don't want to go through the process of assigning the output channel to the thousands of existing stories, nor do I want users to have the ability to unassign this particular one.

I don’t think that’s possible, given the current API, without a lot of nasty hackery.

> In the <cleanup> section , I'm using $burner->preview(), which takes an OC ID as a fourth parameter, but getting the following error:
>
> Can't locate object method "apache_req" via package "HTML::Mason::Request" at /usr/local/bricolage/lib/Bric/App/Util.pm line 667, <GEN1> line 1215.
>
> It appears that the method "apache_req" is indeed not defined. However, it looks like it is in the most recent version of HTML::Mason::Request.

That method has been in HTML::Mason::ApacheHandler::Request since the beginning of time (I see a reference to it in Mason's changes from 2002). However, if you're using bric_queued, the templates do not run inside Apache, so it wouldn't be available.

> Here are my questions:
>
> 1) Assuming I fix this error, is it even possible to publish to an unassigned OC from a story template?

No.

> 2) Can I simply update my version of HTML::Mason::Request?

No.

> 3) Should I update my version of Mason, and if so, do I risk any issues as we're still using Bricolage 1.10.3?

Yeah, it’s good to have Mason up-to-date. No known issues.

> 4) Why is $burner->preview() not intended to be called from a template as the documentation states?

Because it’s designed to be called from the app running inside mod_perl, as you’re finding.

Best,

David
RE: Error when using $burner->preview() [ In reply to ]
> That method has been in HTML::Mason::ApacheHandler::Request since the
> beginning of time (I see a reference to it in Mason's changes from
> 2002). However, if you're using bric_queued, the templates do not run
> inside Apache, so it wouldn't be available.

Ah, thanks David.

Chris