Help - Search - Members - Calendar
Full Version: Using Search for New Comments?
Movable Type Community Forum > Other Product Discussion > Bugs and Odd Behavior
jayseae
Does anyone have search running where you can use it for new comments? According to the documentation, specifying a type of newcomments ought to do the trick.

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));

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. smile.gif
girlie
Unresolved Bug with Band-aid Solution
jayseae
Thanks for the pointer - I couldn't find a thing on the subject when I searched! Easy enough to try out. With one blog, I could even hardcode the name if needed!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.