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

[dw-free] Stray ? in entry URL when clicking on Track and being brought back to the entry

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

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

Only add the "?" if we have a style argument.

Patch by [personal profile] fu.

Files modified:
  • htdocs/manage/tracking/comments.bml
  • htdocs/manage/tracking/entry.bml
--------------------------------------------------------------------------------
diff -r 73c8c962aa89 -r d5c9f9570e7d htdocs/manage/tracking/comments.bml
--- a/htdocs/manage/tracking/comments.bml	Tue Aug 09 17:19:30 2011 +0800
+++ b/htdocs/manage/tracking/comments.bml	Wed Aug 10 12:48:43 2011 +0800
@@ -95,13 +95,16 @@
 
     my $referer = BML::get_client_header('Referer');
     my ( $style ) = ( $referer =~ /\b(style=\w+)/ );
-    $style = LJ::viewing_style_args( split( /=/, $style ) );
+    my @style_args = split( /=/, $style );
 
     return LJ::subscribe_interface(
                                    $remote,
                                    categories => $categories,
                                    journal => $journal,
-                                   ret_url => ($can_watch ? $comment->url( $style ) : $entry->url . "?$style" ),
+                                   ret_url => ($can_watch
+                                                ? $comment->url( LJ::viewing_style_args( @style_args ) )
+                                                : $entry->url( style_args => LJ::viewing_style_opts( @style_args ) )
+                                              ),
                                    default_selected_notifications => ['LJ::NotificationMethod::Email'],
                                    post_to_settings_page => 1,
                                    );
diff -r 73c8c962aa89 -r d5c9f9570e7d htdocs/manage/tracking/entry.bml
--- a/htdocs/manage/tracking/entry.bml	Tue Aug 09 17:19:30 2011 +0800
+++ b/htdocs/manage/tracking/entry.bml	Wed Aug 10 12:48:43 2011 +0800
@@ -97,12 +97,12 @@
 
     my $referer = BML::get_client_header('Referer');
     my ( $style ) = ( $referer =~ /\b(style=\w+)/ );
-    $style = LJ::viewing_style_args( split( /=/, $style ) );
+    my @style_args = split( /=/, $style );
 
     $body .= LJ::subscribe_interface( $remote,
                  journal      => $journal,
                  categories   => $categories,
-                 ret_url      => $entry->url . "?$style",
+                 ret_url      => $entry->url( style_args => LJ::viewing_style_opts( @style_args ) ),
                  default_selected_notifications => ['LJ::NotificationMethod::Email'],
                  post_to_settings_page => 1,
              );
--------------------------------------------------------------------------------