fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2011-11-07 09:02 am

[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 [personal profile] fu.

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;
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org