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

[livejournal] r17711: LJSUP-7378. error: Can't call method "sa...

Committer: gprochaev
LJSUP-7378. error: Can't call method "save_tags"

U   trunk/htdocs/admin/browse/search_tags.bml
U   trunk/htdocs/admin/browse/top_entries_vertical.bml
Modified: trunk/htdocs/admin/browse/search_tags.bml
===================================================================
--- trunk/htdocs/admin/browse/search_tags.bml	2010-11-18 03:39:14 UTC (rev 17710)
+++ trunk/htdocs/admin/browse/search_tags.bml	2010-11-18 03:53:39 UTC (rev 17711)
@@ -17,7 +17,7 @@
     $title = "Recent Entries in verticals";
     my $ret = "";
 
-    my $vert_id = $POST{'vert_id'};
+    my $vert_id = $POST{'vert_id'} ne '' ? $POST{'vert_id'} : undef;
     my $journals = $POST{'journals'};
 
     $ret .= "<form method='POST'>\n";
@@ -35,7 +35,7 @@
     $ret .= LJ::html_select({
                 name => 'vert_id',
                 selected => $vert_id },
-                { text => 'Select Category',
+                { text => 'Select Vertical',
                 value => '' },
                 @vert_ids
             );
@@ -48,12 +48,12 @@
         $vertical = LJ::Vertical->load_by_id($vert_id);
     }
 
-    if (LJ::did_post() && $POST{'save'}) {
+    if (LJ::did_post() && $vertical && $POST{'save'}) {
         my $tags = $POST{'tags'};
         $vertical->save_tags( is_seo => 1, tags => [ map { { journalid => 0, jitemid => 0, tag => $_ } } split /\r\n/, $tags ] );
     }
 
-    if (LJ::did_post()) {
+    if (LJ::did_post() && $vertical) {
         my $seo_tags = $vertical ? $vertical->load_tags ( is_seo => 1 ) : [];
         $seo_tags = join "\n", map { $_->{keyword} } @$seo_tags;
 

Modified: trunk/htdocs/admin/browse/top_entries_vertical.bml
===================================================================
--- trunk/htdocs/admin/browse/top_entries_vertical.bml	2010-11-18 03:39:14 UTC (rev 17710)
+++ trunk/htdocs/admin/browse/top_entries_vertical.bml	2010-11-18 03:53:39 UTC (rev 17711)
@@ -17,7 +17,7 @@
     $title = "Top Entries in communities";
     my $ret = "";
 
-    my $vert_id = $POST{'vert_id'};
+    my $vert_id = $POST{'vert_id'} ne '' ? $POST{'vert_id'} : undef;
     my $journals = $POST{'journals'};
 
     $ret .= "<form method='POST'>\n";
@@ -47,7 +47,7 @@
         $vertical = LJ::Vertical->load_by_id($vert_id);
     }
 
-    if (LJ::did_post() && $POST{'store'}) {
+    if (LJ::did_post() && $vertical && $POST{'store'}) {
         $vertical->set_show_entries ($POST{'show_entries'});
         $vertical->set_not_deleted ($POST{'not_deleted'});
         $vertical->set_remove_after ($POST{'remove_after'});
@@ -91,15 +91,15 @@
 
     }
 
-    if (LJ::did_post() && $POST{'add'}) {
+    if (LJ::did_post() && $vertical && $POST{'add'}) {
         $vertical->add_post ($POST{'url'});
     }
 
-    if (LJ::did_post() && $POST{'delete_post'}) {
+    if (LJ::did_post() && $vertical && $POST{'delete_post'}) {
         $vertical->delete_post (post_id => $POST{'rec_id'});
     }
 
-    if (LJ::did_post()) {
+    if (LJ::did_post() && $vertical) {
         $ret .= "<b><div>Added Posts</div></p>";
         my $posts = $vertical->load_vertical_posts( count => '100', is_random => 0 );
 

Tags: bml, livejournal, 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