mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)
Mark Smith ([staff profile] mark) wrote in [site community profile] changelog2009-02-24 08:06 am

[dw-free] add account type to profile

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

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

Fix situation where cap has no name.

Patch by [personal profile] juliet.

--------------------------------------------------------------------------------
diff -r 1451fd84ea3d -r d6700d0144fc cgi-bin/ljcapabilities.pl
--- a/cgi-bin/ljcapabilities.pl	Tue Feb 24 08:05:13 2009 +0000
+++ b/cgi-bin/ljcapabilities.pl	Tue Feb 24 08:06:54 2009 +0000
@@ -78,7 +78,12 @@ sub name_caps
 sub name_caps
 {
     my $bit = shift;
-    return join( ', ', LJ::caps_string( $bit, '_visible_name' ) );
+    my @caps = LJ::caps_string( $bit, '_visible_name' );
+    if ( @caps ) {
+        return join( ', ', @caps );
+    } else {
+        return LJ::name_caps_short( $bit );
+    }
 }
 
 # <LJFUNC>
@@ -109,7 +114,7 @@ sub caps_string {
         my $class = LJ::class_of_bit($bit);
         next unless $class && LJ::caps_in_group($caps, $class);
         my $name = $LJ::CAP{$bit}->{$name_value};
-        push @classes, $name;
+        push @classes, $name if $name ne "";
     }
 
     return @classes;
diff -r 1451fd84ea3d -r d6700d0144fc htdocs/userinfo.bml
--- a/htdocs/userinfo.bml	Tue Feb 24 08:05:13 2009 +0000
+++ b/htdocs/userinfo.bml	Tue Feb 24 08:06:54 2009 +0000
@@ -369,7 +369,7 @@ body<=
 
     # account type
     my $acctype = LJ::name_caps( $u->caps);
-    $ret .= "<p>$acctype</p>";
+    $ret .= "<p>$acctype</p>" if $acctype;
 
     # journal creation date
     my $jcdate = BML::ml( '.details.createdon2', { createdate => LJ::mysql_time( $u->timecreate )  } );
--------------------------------------------------------------------------------

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