[dw-free] Strip out NavTag code
[commit: http://hg.dwscoalition.org/dw-free/rev/d7d16ac3a92e]
http://bugs.dwscoalition.org/show_bug.cgi?id=4403
Strip out LJ::NavTag code (unused)
Patch by
kaberett.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=4403
Strip out LJ::NavTag code (unused)
Patch by
Files modified:
- cgi-bin/DW/Controller/Search/Multisearch.pm
--------------------------------------------------------------------------------
diff -r 6fc4bb9bb5b3 -r d7d16ac3a92e cgi-bin/DW/Controller/Search/Multisearch.pm
--- a/cgi-bin/DW/Controller/Search/Multisearch.pm Thu Jul 12 17:02:37 2012 +0800
+++ b/cgi-bin/DW/Controller/Search/Multisearch.pm Thu Jul 12 17:48:09 2012 +0800
@@ -57,40 +57,18 @@
}
}
- eval "use LJ::NavTag;";
- return error_ml( 'error.tempdisabled' ) if $@;
-
- my @dests = LJ::NavTag->dests_of_tag( $q );
- my $last_is_untrusted = 0;
-
- if ( $type eq "nav_and_user" ) {
- if ( my $u = LJ::load_user_or_identity($q) ) {
- push @dests, LJ::NavTag::Dest->new( type => "LJUSER",
- dest => $u->user );
-
- # Presumably users will start registering usernames that match
- # our site navigation tags, so let's preempt that and push them
- # into a bottom section when site-defined tags are also present.
- $last_is_untrusted = 1 if $u->is_visible;
- }
- }
+ if ( $type eq "nav_and_user" ) {
+ if ( my $u = LJ::load_user_or_identity($q) ) {
+ return $r->redirect( $u->profile_url() );
+ }
+ }
my $eq = LJ::ehtml( $q );
- return error_ml( '/multisearch.tt.errorpage.nomatch.nav', { query => $eq } )
- unless @dests;
- return $r->redirect( $dests[0]->url ) if @dests == 1;
-
- # multiple matches
- my @cats = ( { name => 'site', list => \@dests } );
- push @cats, { name => 'user', list => [ pop @dests ] }
- if $last_is_untrusted;
-
- $rv->{type} = 'nav';
- $rv->{query} = $eq;
- $rv->{cats} = \@cats;
+ return error_ml( '/multisearch.tt.errorpage.nomatch.nav', { query => $eq } );
return DW::Template->render_template( $tpl, $rv );
- };
+
+ };
$f_user = sub {
my $user = $q;
--------------------------------------------------------------------------------
