david at kineticode
Nov 14, 2011, 3:22 PM
Post #2 of 3
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?
> 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?
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.