Committer: anazarov
LJSUP-10285: Self promo. User gets incorrect error when he tries to promote entry with incorrect IDU trunk/cgi-bin/LJ/Pay/SelfPromo.pm U trunk/cgi-bin/LJ/Widget/Shop/View/SelfPromo.pm
Modified: trunk/cgi-bin/LJ/Pay/SelfPromo.pm =================================================================== --- trunk/cgi-bin/LJ/Pay/SelfPromo.pm 2011-11-02 08:53:35 UTC (rev 11138) +++ trunk/cgi-bin/LJ/Pay/SelfPromo.pm 2011-11-02 09:24:42 UTC (rev 11139) @@ -54,6 +54,7 @@ }; ## journal checks + unless ( $journal and $poster ) { return $err->('not_found') } my $journal_adult = $journal->adult_content_calculated; unless ( $journal->is_visible ) { return $err->('journal_invisible'); } unless ( $journal_adult eq 'none' ) { Modified: trunk/cgi-bin/LJ/Widget/Shop/View/SelfPromo.pm =================================================================== --- trunk/cgi-bin/LJ/Widget/Shop/View/SelfPromo.pm 2011-11-02 08:53:35 UTC (rev 11138) +++ trunk/cgi-bin/LJ/Widget/Shop/View/SelfPromo.pm 2011-11-02 09:24:42 UTC (rev 11139) @@ -198,11 +198,14 @@ my $ml_var = '/shop/selfpromo.bml.error.entry_ineligible.' . $ineligible_reason; + my $poster = $entry->poster? $entry->poster->ljuser_display : undef; + my $journal = $entry->journal? $entry->journal->ljuser_display : undef; + $self->ml_error( $ml_var, { 'entry_url' => $entry_url, - 'journal_ljuser' => $entry->journal->ljuser_display, - 'poster_ljuser' => $entry->poster->ljuser_display, + 'journal_ljuser' => $journal, + 'poster_ljuser' => $poster, }, ); }