This page includes some sample code for setting up a new comment search. I tried adding that and it didn't work.
The message I'm getting is Can't call method "name" on an undefined value at lib/MT/Template/Context.pm line 430.
I think I've tracked this to this piece of code:
CODE
defined(my $res = $build->build($ctx, $tokens, {
NoSearch => $app->{query}->param('help') ||
($app->{searchparam}{Type} ne 'newcomments' &&
(!$ctx->stash('search_string') ||
$ctx->stash('search_string') !~ /\S/)) ? 1 : 0,
NoSearchResults => $ctx->stash('search_string') &&
$ctx->stash('search_string') =~ /\S/ &&
!scalar @results,
SearchResults => scalar @results,
} ))
or return $app->error($app->translate(
"Building results failed: [_1]", $build->errstr));
NoSearch => $app->{query}->param('help') ||
($app->{searchparam}{Type} ne 'newcomments' &&
(!$ctx->stash('search_string') ||
$ctx->stash('search_string') !~ /\S/)) ? 1 : 0,
NoSearchResults => $ctx->stash('search_string') &&
$ctx->stash('search_string') =~ /\S/ &&
!scalar @results,
SearchResults => scalar @results,
} ))
or return $app->error($app->translate(
"Building results failed: [_1]", $build->errstr));
Anyone have any ideas?
Update: Search works fine for regular search. I want to make use of the newcomment search method. Actually, I want to do more than that. But for the moment, that'll do.