[dw-free] Entry options page broken when user is not logged in
[commit: http://hg.dwscoalition.org/dw-free/rev/845524541110]
http://bugs.dwscoalition.org/show_bug.cgi?id=4043
Move the redirect on not logged in to the handler, up from the convenience
method.
Patch by
fu.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=4043
Move the redirect on not logged in to the handler, up from the convenience
method.
Patch by
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Files modified:
- cgi-bin/DW/Controller/Entry.pm
-------------------------------------------------------------------------------- diff -r 94966d1b5f13 -r 845524541110 cgi-bin/DW/Controller/Entry.pm --- a/cgi-bin/DW/Controller/Entry.pm Mon Nov 07 16:19:45 2011 +0800 +++ b/cgi-bin/DW/Controller/Entry.pm Mon Nov 07 17:03:05 2011 +0800 @@ -1055,7 +1055,10 @@ =cut sub options_handler { - return DW::Template->render_template( 'entry/options.tt', _options( @_ ) ); + my ( $ok, $rv ) = controller(); + return $rv unless $ok; + + return DW::Template->render_template( 'entry/options.tt', _options( $rv->{remote} ) ); } @@ -1065,7 +1068,10 @@ =cut sub options_rpc_handler { - my $vars = _options( @_ ); + my ( $ok, $rv ) = controller(); + return $rv unless $ok; + + my $vars = _options( $rv->{remote} ); $vars->{use_js} = 1; my $status = @{$vars->{error_list} || []} ? DW::Request->get->HTTP_BAD_REQUEST : DW::Request->get->HTTP_OK; @@ -1088,10 +1094,7 @@ } sub _options { - my ( $ok, $rv ) = controller(); - return $rv unless $ok; - - my $u = $rv->{remote}; + my $u = $_[0]; my $panel_element_name = "visible_panels"; my @panel_options; --------------------------------------------------------------------------------