Committer: gariev
LJSUP-8936: Status of Give Button is not saved when post is editedU trunk/cgi-bin/LJ/Widget/EntryForm.pm
Modified: trunk/cgi-bin/LJ/Widget/EntryForm.pm =================================================================== --- trunk/cgi-bin/LJ/Widget/EntryForm.pm 2011-06-01 07:56:27 UTC (rev 19190) +++ trunk/cgi-bin/LJ/Widget/EntryForm.pm 2011-06-01 09:00:01 UTC (rev 19191) @@ -1017,7 +1017,6 @@ return unless LJ::is_enabled("give_features"); my @give_menu = ( - "" => BML::ml('entryform.give.default'), "enable" => BML::ml('entryform.give.enable'), "disable" => BML::ml('entryform.give.disable'), ); @@ -1025,11 +1024,19 @@ $out .= "<label for='prop_give_features' class='left options'>" . BML::ml('entryform.give') . "</label>\n"; + my $is_enabled; + if ($opts->{'mode'} eq "edit") { + $is_enabled = $opts->{'prop_give_features'}; + } else { + my $journalu = LJ::load_user($opts->{'usejournal'}) || $remote; + $is_enabled = $journalu && $journalu->prop('give_features'); + } + $out .= LJ::html_select({ name => 'prop_give_features', id => 'prop_give_features', class => 'select', - selected => $opts->{prop_give_features} || "", + selected => ($is_enabled) ? "enable" : "disable", tabindex => $self->tabindex, }, @give_menu);