Committer: sbelyaev
LJSUP-9307: edit journal functionality fix.U trunk/cgi-bin/LJ/Widget/EntryChooser.pm U trunk/cgi-bin/ljprotocol.pl
Modified: trunk/cgi-bin/LJ/Widget/EntryChooser.pm =================================================================== --- trunk/cgi-bin/LJ/Widget/EntryChooser.pm 2012-01-24 11:36:32 UTC (rev 20969) +++ trunk/cgi-bin/LJ/Widget/EntryChooser.pm 2012-01-24 11:42:58 UTC (rev 20970) @@ -21,7 +21,7 @@ my @entries_display; foreach my $entry (@$entries) { - my $entry_id = $entry->is_delayed ? $entry->delayedid : $entry->itemid ; + my $entry_id = $entry->is_delayed ? $entry->delayedid : $entry->ditemid ; my $entry_can_edit = $entry->poster->equals($remote) && ! $entry->journal->is_readonly && Modified: trunk/cgi-bin/ljprotocol.pl =================================================================== --- trunk/cgi-bin/ljprotocol.pl 2012-01-24 11:36:32 UTC (rev 20969) +++ trunk/cgi-bin/ljprotocol.pl 2012-01-24 11:42:58 UTC (rev 20970) @@ -2854,7 +2854,7 @@ if ( $delayedid ) { return fail( $err, 217 ) if $req->{itemid} || $req->{anum}; - return fail( $err, 215 ) unless $req->{tz}; + return fail( $err, 215 ) unless $req->{tz}; $req->{ext}->{flags} = $flags; $req->{ext}->{flags}->{u} = undef; # it's no need to be stored @@ -2867,7 +2867,6 @@ ); return fail($err, 508) unless $entry; - if ($req->{'event'} !~ /\S/ ) { $entry->delete(); $res->{delayedid} = $delayedid; @@ -2877,12 +2876,17 @@ actiontarget => $delayedid, method => 'protocol', }) unless $flags->{noauth}; + return $res; } # updating an entry: return undef unless common_event_validation($req, $err, $flags); + + $entry->update($req); + $res->{type} = 'delayed'; + $res->{delayedid} = $delayedid; } return $res if $res->{type};