Mailing List Archive

send_msg problems
Hi,

Sometimes I call send_msg from my templates (when texing is preformed
down there)
I get messages in my browser while previewing and in a log file while
publishing (->bric_queue) - this is perfect.


But when preview_another is called I get an error:

Can't locate object method "apache_req" via package
"HTML::Mason::Request" at
/usr/local/bric.delta.pl/lib/Bric/App/Util.pm line 660, <GEN9> chunk
434.

# line 660 (sub _send_msg) in Bric/App/Util.pm:

my $r = $m->apache_req;

What is going on?
[ publish_another does't give an error ]

Krzysztof
Re: send_msg problems [ In reply to ]
bric_queued does not run under mod_perl, so you can't use any functions that use mod_perl. Why are you calling add_msg()?

Best,

David

On Jun 20, 2010, at 5:00 AM, Krzysztof Rudnik wrote:

> Hi,
>
> Sometimes I call send_msg from my templates (when texing is preformed
> down there)
> I get messages in my browser while previewing and in a log file while
> publishing (->bric_queue) - this is perfect.
>
>
> But when preview_another is called I get an error:
>
> Can't locate object method "apache_req" via package
> "HTML::Mason::Request" at
> /usr/local/bric.delta.pl/lib/Bric/App/Util.pm line 660, <GEN9> chunk
> 434.
>
> # line 660 (sub _send_msg) in Bric/App/Util.pm:
>
> my $r = $m->apache_req;
>
> What is going on?
> [ publish_another does't give an error ]
>
> Krzysztof
Re: send_msg problems [ In reply to ]
Sorry,
I've made a mistake: the problem concerns status_msg /not send_msg/

I have TeX action (based on DTDValidate)
It uses an external module TeXJob which compiles the stories.
It sometimes calls status_msg to show what is going on.
Everything was OK until today: messages were sending to a browser
while previewing and to logs (bric_queque.log) while publishing.
Today I've modified my templates by adding cover_blazer.mc which calls
blaze_another for various cover stories and started getting strange
error messages:
I have storyA and a cover storyB which depends on storyA
I can publish storyA without any problems: storyB gets published as
well. Messages sent by status_msg during publishing storyA and storyB
are written to bric_queue.log

Preview makes problems.
When I preview storyA then TeX action on storyA goes cleanly but TeX
action on storyB fails with an error:

Can't locate object method "apache_req" via package
"HTML::Mason::Request" at
/usr/local/bric.delta.pl/lib/Bric/App/Util.pm line 660, <GEN7> line
188.

I tried to simplify the problem and modified cover_blazer.mc
<%init>
use Bric::App::Util qw(:browser);
status_msg('TEST');
</%init>
and I get exactly the same error.

When I remove
status_msg('TEST');
then previewing goes cleanly - I can see in my browser messages sent
by status_msg from TeX action.

I can understand nothing!!!

Krzysztof


Krzysztof









On Sun, Jun 20, 2010 at 8:23 PM, David E. Wheeler <david@kineticode.com> wrote:
> bric_queued does not run under mod_perl, so you can't use any functions that use mod_perl.

Everything is ok when I preview and publish stories unless
preview_another is called.
[.when publish another is called in both cases (publish/preview)
nothing wrong happens: messages are written to logs]

when preview





>
> Best,
>
> David
>
> On Jun 20, 2010, at 5:00 AM, Krzysztof Rudnik wrote:
>
>> Hi,
>>
>> Sometimes I call send_msg from my templates (when texing is preformed
>> down there)
>> I get messages in my browser while previewing and in a log file while
>> publishing (->bric_queue) - this is perfect.
>>
>>
>> But when preview_another is called I get an error:
>>
>> Can't locate object method "apache_req" via package
>> "HTML::Mason::Request" at
>> /usr/local/bric.delta.pl/lib/Bric/App/Util.pm line 660, <GEN9> chunk
>> 434.
>>
>> # line 660 (sub _send_msg) in  Bric/App/Util.pm:
>>
>> my $r = $m->apache_req;
>>
>> What is going on?
>> [ publish_another does't give an error ]
>>
>> Krzysztof
>
>
Re: send_msg problems [ In reply to ]
On Jun 20, 2010, at 3:43 PM, Krzysztof Rudnik wrote:

> When I preview storyA then TeX action on storyA goes cleanly but TeX
> action on storyB fails with an error:
>
> Can't locate object method "apache_req" via package
> "HTML::Mason::Request" at
> /usr/local/bric.delta.pl/lib/Bric/App/Util.pm line 660, <GEN7> line
> 188.
>
> I tried to simplify the problem and modified cover_blazer.mc
> <%init>
> use Bric::App::Util qw(:browser);
> status_msg('TEST');
> </%init>
> and I get exactly the same error.
>
> When I remove
> status_msg('TEST');
> then previewing goes cleanly - I can see in my browser messages sent
> by status_msg from TeX action.
>
> I can understand nothing!!!

What version of Bricolage is this?

Best,

David
Re: send_msg problems [ In reply to ]
Bric 2.0


On Mon, Jun 21, 2010 at 1:47 AM, David E. Wheeler <david@kineticode.com> wrote:
> On Jun 20, 2010, at 3:43 PM, Krzysztof Rudnik wrote:
>
>> When I preview storyA then TeX action on storyA goes cleanly but TeX
>> action on storyB fails with an error:
>>
>> Can't locate object method "apache_req" via package
>> "HTML::Mason::Request" at
>> /usr/local/bric.delta.pl/lib/Bric/App/Util.pm line 660, <GEN7> line
>> 188.
>>
>> I tried to simplify the problem and modified cover_blazer.mc
>> <%init>
>> use Bric::App::Util qw(:browser);
>> status_msg('TEST');
>> </%init>
>> and I get exactly the same error.
>>
>> When I remove
>> status_msg('TEST');
>> then previewing goes cleanly - I can see in my browser messages sent
>> by status_msg from  TeX action.
>>
>> I can understand nothing!!!
>
> What version of Bricolage is this?
>
> Best,
>
> David
>
>
>
Re: send_msg problems [ In reply to ]
On Jun 21, 2010, at 1:15 AM, Krzysztof Rudnik wrote:

> Bric 2.0

Odd. The line in question is:

if (my $m = HTML::Mason::Request->instance) {

That method is implemented as:

sub instance {
return $HTML::Mason::Commands::m;
}

Simple. This is exactly where the Bricolage UI request instance should be. The burner request object should be $Bric::Util::Burner::Commands::m. So that method should be fetching the UI request object, not the burner request object that's doing the previewing. And yet the error you're getting:

> Can't locate object method "apache_req" via package
> "HTML::Mason::Request" at

Indicates that it's the burner request object, because the UI request object is an HTML::Mason::Request::ApacheHandler object.

So I don't know what the problem is offhand. Would you file a bug report, please?

http://bugs.bricolagecms.org/

Thanks,

David
Re: send_msg problems [ In reply to ]
On Mon, Jun 21, 2010 at 6:08 PM, David E. Wheeler <david@kineticode.com> wrote:
> On Jun 21, 2010, at 1:15 AM, Krzysztof Rudnik wrote:
>
>> Bric 2.0
>
> Odd. The line in question is:
>
>    if (my $m = HTML::Mason::Request->instance) {
>
> That method is implemented as:
>
> sub instance {
>    return $HTML::Mason::Commands::m;
> }
>
> Simple. This is exactly where the Bricolage UI request instance should be. The burner request object should be $Bric::Util::Burner::Commands::m. So that method should be fetching the UI request object, not the burner request object that's doing the previewing. And yet the error you're getting:
>
>> Can't locate object method "apache_req" via package
>> "HTML::Mason::Request" at
>
> Indicates that it's the burner request object, because the UI request object is an HTML::Mason::Request::ApacheHandler object.
>
> So I don't know what the problem is offhand. Would you file a bug report, please?
OK, I will
thanks
Krzysztof

>
>  http://bugs.bricolagecms.org/
>
> Thanks,
>
> David
>
>