fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2010-11-17 06:57 am

[dw-free] Warnings when loading a comment/reply page in site skin

[commit: http://hg.dwscoalition.org/dw-free/rev/624bda6a8380]

http://bugs.dwscoalition.org/show_bug.cgi?id=3236

Tweak for a couple more warnings.

Patch by [personal profile] fu.

Files modified:
  • cgi-bin/LJ/Talk.pm
  • htdocs/talkpost_do.bml
--------------------------------------------------------------------------------
diff -r fe774f46a075 -r 624bda6a8380 cgi-bin/LJ/Talk.pm
--- a/cgi-bin/LJ/Talk.pm	Wed Nov 17 14:20:56 2010 +0800
+++ b/cgi-bin/LJ/Talk.pm	Wed Nov 17 14:56:53 2010 +0800
@@ -186,17 +186,15 @@ sub init
     my $ju = undef;
     my $item = undef;        # hashref; journal item conversation is in
 
-    $form->{$_} ||= 0 foreach qw( itemid thread replyto );
-
     # defaults, to be changed later:
-    $init->{'itemid'} = $form->{'itemid'}+0;
+    $init->{'itemid'} = ( $form->{'itemid'} || 0 )+0;
     $init->{'ditemid'} = $init->{'itemid'};
-    $init->{'thread'} = $form->{'thread'}+0;
+    $init->{'thread'} = ( $form->{'thread'} || 0 )+0;
     $init->{'dthread'} = $init->{'thread'};
     $init->{'clustered'} = 0;
-    $init->{'replyto'} = $form->{'replyto'}+0;
+    $init->{'replyto'} = ( $form->{'replyto'} || 0 )+0;
     $init->{'style'} = $form->{'style'}
-        if $form->{'style'} =~ /^(?:mine|light)$/;
+        if $form->{style} && $form->{style} =~ /^(?:mine|light)$/;
 
     if ($journal) {
         # they specified a journal argument, which indicates new style.
diff -r fe774f46a075 -r 624bda6a8380 htdocs/talkpost_do.bml
--- a/htdocs/talkpost_do.bml	Wed Nov 17 14:20:56 2010 +0800
+++ b/htdocs/talkpost_do.bml	Wed Nov 17 14:56:53 2010 +0800
@@ -170,13 +170,14 @@ body<=
     }
 
 
-    my $talkurl = $init->{talkurl};
+    my ( $talkurl, $entryu, $parent, $comment, $item );
 
-    my $entryu   = $init->{entryu};
-    my $journalu = $init->{journalu};
-    my $parent   = $init->{parent};
-    my $comment  = $init->{comment};
-    my $item     = $init->{item};
+    $talkurl = $init->{talkurl};
+    $entryu   = $init->{entryu};
+    $journalu = $init->{journalu};
+    $parent   = $init->{parent};
+    $comment  = $init->{comment};
+    $item     = $init->{item};
 
     my $unscreen_parent = $POST{unscreen_parent} ? 1 : 0;
 
--------------------------------------------------------------------------------

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