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-03 02:59 am

[dw-free] "upgrade" link from account level settings redirects you to the shop front page

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

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

Fix the URL.

Patch by [personal profile] fu.

Files modified:
  • cgi-bin/DW/Setting/Display/AccountLevel.pm
--------------------------------------------------------------------------------
diff -r c0efdc40d201 -r 4756db2b8254 cgi-bin/DW/Setting/Display/AccountLevel.pm
--- a/cgi-bin/DW/Setting/Display/AccountLevel.pm	Wed Nov 03 10:55:19 2010 +0800
+++ b/cgi-bin/DW/Setting/Display/AccountLevel.pm	Wed Nov 03 10:58:54 2010 +0800
@@ -34,13 +34,14 @@ sub actionlink {
 
     my $paidstatus = DW::Pay::get_paid_status( $u );
 
+    my $gifturl = $u->gift_url;
     if ( $paidstatus && $paidstatus->{permanent} ) {
         return "";
     } elsif ( $paidstatus && DW::Pay::get_account_type( $u->userid ) eq "premium" ) {
          # tell premium paid users to just add more time, not upgrade
-         return "<a href='$LJ::SITEROOT/shop/?for=gift&user=" . $u->user . "'>" . $class->ml( 'setting.display.accounttype.addmore' ) . "</a>";
+         return "<a href='$gifturl'>" . $class->ml( 'setting.display.accounttype.addmore' ) . "</a>";
     } else {
-        return "<a href='$LJ::SITEROOT/shop/?for=gift&user=" . $u->user . "'>" . $class->ml( 'setting.display.accounttype.upgrade' ) . "</a>";
+        return "<a href='$gifturl'>" . $class->ml( 'setting.display.accounttype.upgrade' ) . "</a>";
     }
 }
 
--------------------------------------------------------------------------------

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