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

[dw-free] formatting preferences lost post-subscription

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

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

Carry over ?style=light/site/mine when tracking an entry or comment.

Patch by [personal profile] kareila.

Files modified:
  • htdocs/manage/subscriptions/comments.bml
  • htdocs/manage/subscriptions/entry.bml
--------------------------------------------------------------------------------
diff -r 306e22f2aafb -r eea9d8e416c1 htdocs/manage/subscriptions/comments.bml
--- a/htdocs/manage/subscriptions/comments.bml	Thu Jul 08 16:07:29 2010 +0800
+++ b/htdocs/manage/subscriptions/comments.bml	Thu Jul 08 16:37:08 2010 +0800
@@ -103,11 +103,15 @@ body<=
                                      },
                       ];
 
+    my $referer = BML::get_client_header('Referer');
+    my ( $style ) = ( $referer =~ /\b(style=\w+)/ );
+    $style = LJ::viewing_style_args( split( /=/, $style ) );
+
     return LJ::subscribe_interface(
                                    $remote,
                                    categories => $categories,
                                    journal => $journal,
-                                   ret_url => ($can_watch ? $comment->url : $entry->url),
+                                   ret_url => ($can_watch ? $comment->url( $style ) : $entry->url . "?$style" ),
                                    default_selected_notifications => ['LJ::NotificationMethod::Email'],
                                    post_to_settings_page => 1,
                                    );
diff -r 306e22f2aafb -r eea9d8e416c1 htdocs/manage/subscriptions/entry.bml
--- a/htdocs/manage/subscriptions/entry.bml	Thu Jul 08 16:07:29 2010 +0800
+++ b/htdocs/manage/subscriptions/entry.bml	Thu Jul 08 16:37:08 2010 +0800
@@ -88,10 +88,14 @@ body<=
             flags   => LJ::Subscription::TRACKING,
         );
 
+    my $referer = BML::get_client_header('Referer');
+    my ( $style ) = ( $referer =~ /\b(style=\w+)/ );
+    $style = LJ::viewing_style_args( split( /=/, $style ) );
+
     $body .= LJ::subscribe_interface( $remote,
                  journal      => $journal,
                  categories   => $categories,
-                 ret_url      => $entry->url,
+                 ret_url      => $entry->url . "?$style",
                  default_selected_notifications => ['LJ::NotificationMethod::Email'],
                  post_to_settings_page => 1,
              );
--------------------------------------------------------------------------------