wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[livejournal] r17803: LJSUP-7447. Preview button doesn't work ...

Committer: gprochaev
LJSUP-7447. Preview button doesn't work in the "Search words in verticals" admin tool

U   trunk/cgi-bin/LJ/Widget/Search.pm
U   trunk/htdocs/admin/browse/search_tags.bml
Modified: trunk/cgi-bin/LJ/Widget/Search.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/Search.pm	2010-11-26 08:17:05 UTC (rev 17802)
+++ trunk/cgi-bin/LJ/Widget/Search.pm	2010-11-26 08:23:28 UTC (rev 17803)
@@ -91,11 +91,14 @@
 
         my $args = BML::get_query_string();
         $uri .= "?$args" if $args;
+        my $tags = $opts{'preview'}
+                ? [ map { { tag => $_ } } @{$opts{'preview'}} ]
+                : [ map { { tag => $_ } } split /\n/m, $stored_words ];
         $template->param (
             vertical_name   => $vertical->name,
             search_url      => $uri,
             view            => $opts{'view'},
-            tags            => [ map { { tag => $_ } } split /\n/m, $stored_words ],
+            tags            => $tags,
         );
 
         return $template->output;

Modified: trunk/htdocs/admin/browse/search_tags.bml
===================================================================
--- trunk/htdocs/admin/browse/search_tags.bml	2010-11-26 08:17:05 UTC (rev 17802)
+++ trunk/htdocs/admin/browse/search_tags.bml	2010-11-26 08:23:28 UTC (rev 17803)
@@ -96,7 +96,7 @@
         # preview
         $body .= '</div><div style="float:right;width:650px;" class="appwidget-browse"><div class="vertical_view">';
 
-        $body .= LJ::Widget::Search->render(vertical => $vertical, type => "tags", view => 'communities');
+        $body .= LJ::Widget::Search->render(vertical => $vertical, type => "tags", view => 'communities', preview => [ split /\s*\n+\s*/m, $words ]);
         $body .= '</div></div>';
     }
     $body .= "<p style='clear:both;'><a href='/admin/browse/'>Back to main page</a></p>";

Tags: bml, livejournal, pm, wisest-owl
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments