It works fine when the blog is published in the foreground (that is, background publishing is turned off). The code looks like the following, where I'm creating a new template and want to use the "build_page" method to build the proper output based on the template. (The parameters passed to the template in the build_page call are left out for simplicity.):
CODE
my $tmpl = new MT::Template;
$tmpl->text( $myTemplate );
my $app = MT->instance;
my $myOutput = $app->build_page( $tmpl, { } );
$tmpl->text( $myTemplate );
my $app = MT->instance;
my $myOutput = $app->build_page( $tmpl, { } );
But, when I turn background publishing on, the run-periodic-tasks script fails on build with the following error (MT4.1):
QUOTE
Eval failure: Can't locate object method "mode" via package "MT" at ../lib/MT.pm line 1931.
Can anyone tell me what I need to do in order to make this section work in background mode as well? And, can you perhaps tell me why it isn't working in background mode?
