madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[livejournal] r20247: LJSUP-10058: Fixed edit and remove, and ...

Committer: sbelyaev
LJSUP-10058: Fixed edit and remove, and convert cases.
U   trunk/cgi-bin/LJ/DelayedEntry/Scheduler.pm
U   trunk/cgi-bin/ljprotocol.pl
U   trunk/htdocs/editjournal.bml
Modified: trunk/cgi-bin/LJ/DelayedEntry/Scheduler.pm
===================================================================
--- trunk/cgi-bin/LJ/DelayedEntry/Scheduler.pm	2011-10-07 07:52:26 UTC (rev 20246)
+++ trunk/cgi-bin/LJ/DelayedEntry/Scheduler.pm	2011-10-07 08:18:56 UTC (rev 20247)
@@ -17,8 +17,8 @@
     my @entries;
     
     my $list = $dbh->selectall_arrayref("SELECT journalid, delayedid, posterid " .
-                                     "FROM delayedlog2 ".
-                                     "WHERE posttime <= NOW()");
+                                        "FROM delayedlog2 ".
+                                        "WHERE posttime <= NOW()");
 
     foreach my $tuple (@$list) {
         push @entries, LJ::DelayedEntry->load_data($dbh,
@@ -60,7 +60,6 @@
                          $entry->data->{subject},
                          $post_status->{error_message});
         }
-        
         if ( $post_status->{delete_entry} ) {
             $entry->delete();
         }

Modified: trunk/cgi-bin/ljprotocol.pl
===================================================================
--- trunk/cgi-bin/ljprotocol.pl	2011-10-07 07:52:26 UTC (rev 20246)
+++ trunk/cgi-bin/ljprotocol.pl	2011-10-07 08:18:56 UTC (rev 20247)
@@ -2639,15 +2639,24 @@
                 return $res;
             }
 
-
             $entry->update($req);
             if ( LJ::DelayedEntry::is_future_date($req) ) {
+                warn "delayed usual";
                 $res->{type} = 'delayed';
             } else {
                 my $out = $entry->convert;
+
+                if ( $out->{delete_entry} ) {
+                    $entry->delete();
+                }
+
                 $res->{type}   = 'posted';
                 $res->{itemid} = $out->{res}->{itemid};
                 $res->{anum}   = $out->{res}->{anum};
+
+                $res->{'url'} = LJ::item_link(  $uowner,
+                                                $res->{itemid},
+                                                $res->{anum} );
             }
         }
 

Modified: trunk/htdocs/editjournal.bml
===================================================================
--- trunk/htdocs/editjournal.bml	2011-10-07 07:52:26 UTC (rev 20246)
+++ trunk/htdocs/editjournal.bml	2011-10-07 08:18:56 UTC (rev 20247)
@@ -484,13 +484,18 @@
                 unless ($res) {
                     return "<?h1 $ML{'Error'} h1?><?p $ML{'.error.modify'} <ul><li><b>" . LJ::Protocol::error_message($err) . "</b></li></ul> p?>";
                 }
+               
 
                 my $deleted = $req{event} ? 0 : 1;
                 my $journalu = $usejournal ? $usejournal_u : $remote;
                 my $j_base = $journalu->journal_base;
                 my $entry_url = '';
-                if ($entry_obj->is_delayed) {
-                    $entry_url = $entry_obj->url;
+                if ($entry_obj->is_delayed && $res->{itemid}) {
+                    if (!$res->{itemid}) {
+                        $entry_url = $entry_obj->url;
+                    } else {
+                        $entry_url = $res->{url};
+                    }
                 } else {
                     $entry_url = LJ::item_link($journalu, $itemid, $res->{anum});
                 }

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