afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
afuna ([personal profile] afuna) wrote in [site community profile] changelog2009-07-20 03:47 pm

[dw-free] links in comment pages with ?style=light in the URL point to style=mine, not style=light

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

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

Fix style=mine/style=light in generated links.

Patch by [personal profile] yvi.

Files modified:
  • htdocs/talkpost.bml
  • htdocs/talkread.bml
--------------------------------------------------------------------------------
diff -r 5f3e59144268 -r f92bdbc5f35a htdocs/talkpost.bml
--- a/htdocs/talkpost.bml	Mon Jul 20 10:01:48 2009 -0500
+++ b/htdocs/talkpost.bml	Mon Jul 20 15:46:42 2009 +0000
@@ -112,8 +112,12 @@ body<=
 
     my $itemid = $init->{'itemid'};
 
-    my $stylemine = $init->{'style'} eq "mine" ? "style=mine" : "";
-    my $formatlight = $GET{'format'} eq 'light' ? 'format=light' : '';
+    my $formatlight = ( ( $GET{format} eq 'light' ) || ( $GET{style} eq 'light' ) ) ? 'style=light' : '';
+    my $stylemine = "";
+
+    # FIXME: $init->{style} returns 'mine' even if style=format is used instead of style=mine
+    # if that is fixed, this can be adjusted
+    $stylemine = ( $init->{style} eq "mine" ) ? "style=mine" : "" unless $formatlight;
 
     ## load the journal item
     my $item = LJ::Talk::get_journal_item($u, $itemid);
diff -r 5f3e59144268 -r f92bdbc5f35a htdocs/talkread.bml
--- a/htdocs/talkread.bml	Mon Jul 20 10:01:48 2009 -0500
+++ b/htdocs/talkread.bml	Mon Jul 20 15:46:42 2009 +0000
@@ -100,8 +100,12 @@ body<=
     $itemid = $init->{'itemid'}+0;
 
     # Get format/style parameters to pass to the URL later
-    my $stylemine = $init->{'style'} eq "mine" ? "style=mine" : "";
-    my $formatlight = $GET{'format'} eq 'light' ? 'format=light' : '';
+    my $formatlight = ( ( $GET{format} eq 'light' ) || ( $GET{style} eq 'light' ) ) ? 'style=light' : '';
+    my $stylemine = "";
+
+    # FIXME: $init->{style} returns 'mine' even if style=format is used instead of style=mine
+    # if that is fixed, this can be adjusted
+    $stylemine = ( $init->{style} eq "mine" ) ? "style=mine" : "" unless $formatlight;
 
     my $item = LJ::Talk::get_journal_item($u, $itemid);
 
--------------------------------------------------------------------------------