Redirect the poll results to the appropriate style=... if applicable.
Patch by fu.
diffs (49 lines):
diff -r 5fc0877f7daa -r 73973c3e26ea cgi-bin/LJ/Entry.pm
--- a/cgi-bin/LJ/Entry.pm Tue Apr 19 21:56:07 2011 +0800
+++ b/cgi-bin/LJ/Entry.pm Tue Apr 19 22:27:40 2011 +0800
@@ -225,7 +225,11 @@ sub reply_url {
# returns permalink url
sub url {
my ( $self, %opts ) = @_;
+ my %style_args = %{ delete $opts{style_args} || {} };
+
my %args = %opts; # used later
+ @args{keys %style_args} = values %style_args;
+
my $u = $self->{u};
my $view = delete $opts{view};
my $anchor = delete $opts{anchor};
diff -r 5fc0877f7daa -r 73973c3e26ea cgi-bin/LJ/Poll.pm
--- a/cgi-bin/LJ/Poll.pm Tue Apr 19 21:56:07 2011 +0800
+++ b/cgi-bin/LJ/Poll.pm Tue Apr 19 22:27:40 2011 +0800
@@ -893,7 +893,8 @@ sub render {
$preval{$qid} = $value;
}
- $ret .= "<div id='poll-$pollid-container'><form class='LJ_PollForm'
action='$LJ::SITEROOT/poll/?id=$pollid' method='post'>";
+ my $url = LJ::create_url( "/poll/", host => $LJ::DOMAIN_WEB,
viewing_style => 1, args => { id => $pollid } );
+ $ret .= "<div id='poll-$pollid-container'><form class='LJ_PollForm'
action='$url' method='post'>";
$ret .= LJ::form_auth();
$ret .= LJ::html_hidden('pollid', $pollid);
$ret .= LJ::html_hidden('id', $pollid); #for the ajax request
diff -r 5fc0877f7daa -r 73973c3e26ea htdocs/poll/index.bml
--- a/htdocs/poll/index.bml Tue Apr 19 21:56:07 2011 +0800
+++ b/htdocs/poll/index.bml Tue Apr 19 22:27:40 2011 +0800
@@ -15,7 +15,7 @@ _c?>
<?_code
{
use strict;
- use vars qw(%FORM $title $body);
+ use vars qw(%FORM $title $body %GET);
use LJ::Poll;
$title = $ML{'.title'};
@@ -122,7 +122,7 @@ _c?>
$body .= $error;
return;
}
- return BML::redirect($entry->url);
+ return BML::redirect( $entry->url( style_args =>
LJ::viewing_style_opts( %GET ) ) );
}
$body .= $poll->render(mode => $mode, qid => $FORM{qid},
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog