madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[livejournal] r20090: LJSUP-9814, LJSUP-9816: fixed

Committer: sbelyaev
LJSUP-9814, LJSUP-9816: fixed
U   branches/delayed_entries/cgi-bin/LJ/DelayedEntry.pm
U   branches/delayed_entries/htdocs/update.bml
Modified: branches/delayed_entries/cgi-bin/LJ/DelayedEntry.pm
===================================================================
--- branches/delayed_entries/cgi-bin/LJ/DelayedEntry.pm	2011-09-21 02:07:07 UTC (rev 20089)
+++ branches/delayed_entries/cgi-bin/LJ/DelayedEntry.pm	2011-09-21 02:25:02 UTC (rev 20090)
@@ -916,6 +916,7 @@
         my $entry_obj = LJ::DelayedEntry->get_entry_by_id(  $u,
                                                             $delayedid,
                                                             { userid => $userid } );
+        next unless $entry_obj;
         ++$i;
         $res->{"events_${i}_itemid"} = 0;
         $res->{"events_${i}_delayedid"} = $delayedid;
@@ -1407,16 +1408,13 @@
     my ( $uowner, $poster ) = @_;
 
     if ( $uowner->equals( $poster) ){
-        warn "allowed\n";
         return 1;
     }
 
     if ($poster->can_manage($uowner)) {
-        warn "allowed by can_manage\n";
         return 1;
     }
-    
-    warn "forbitten\n";
+
     return 0;
 }
 

Modified: branches/delayed_entries/htdocs/update.bml
===================================================================
--- branches/delayed_entries/htdocs/update.bml	2011-09-21 02:07:07 UTC (rev 20089)
+++ branches/delayed_entries/htdocs/update.bml	2011-09-21 02:25:02 UTC (rev 20090)
@@ -546,6 +546,7 @@
 
                     my $juser = $ju->{'user'};
                     my ($itemid, $anum) = ($res->{'itemid'}, $res->{'anum'});
+                    my $delayedid = $res->{'delayedid'};
                     if ($res->{'itemid'})
                     {
                         $itemlink = LJ::item_link($ju, $itemid, $anum);
@@ -565,15 +566,24 @@
                     my @after_entry_post_extra_options = LJ::run_hooks('after_entry_post_extra_options', user => $ju, itemlink => $itemlink);
                     my $after_entry_post_extra_options = join('', map {$_->[0]} @after_entry_post_extra_options) || '';
 
-                    $$body .= " p?><?p $ML{'.success.links'} p?><ul>" . $writersblocklink .
+                    $$body .= " p?><?p $ML{'.success.links'} p?><ul>" . $writersblocklink;
                         "<li><a href=\"$itemlink\">$ML{'.success.links.view'}</a></li>" .
-                        "<li><a href=\"/editjournal.bml?journal=$juser&itemid=$itemid\">$ML{'.success.links.edit'}</a></li>" .
-                        "<li><a href=\"/tools/memadd.bml?journal=$juser&itemid=$itemid\">$ML{'.success.links.memories'}</a></li>" .
-                        "<li><a href=\"/edittags.bml?journal=$juser&itemid=$itemid\">$ML{'.success.links.tags'}</a></li>" .
+                        my $item_text;
+                        if ($itemid) {
+                            $item_text = "journal=$juser&itemid=$itemid";
+                        } elsif ($delayedid) {
+                            $item_text = "journal=$juser&delayedid=$delayedid";
+                        } else { return "unknown error"; }
+
+                        $$body .= "<li><a href=\"/editjournal.bml?$item_text\">$ML{'.success.links.edit'}</a></li>";
+                        if ($itemid) {
+                            $$body .= "<li><a href=\"/tools/memadd.bml?$item_text\">$ML{'.success.links.memories'}</a></li>";
+                        }
+                        $$body .= "<li><a href=\"/edittags.bml?$item_text\">$ML{'.success.links.tags'}</a></li>" .
                         $after_entry_post_extra_options .
                         "</ul>";
 
-                    $$body .= '<div class="b-tnb-getstart">' . LJ::Widget::Trynbuy->render(stage => 'simple') if ($show_trynbuy);
+                    $$body .= '<div class="b--getstart">' . LJ::Widget::Trynbuy->render(stage => 'simple') if ($show_trynbuy);
                     $$body .= LJ::Widget::GettingStarted->render;
                     $$body .= '</div>' if ($show_trynbuy);
                 }

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