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-06-28 03:36 am

[dw-free] Updating journal only half-works in communities with strict tag permissions

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

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

Don't throw an error if we aren't actually trying to define tags.

Patch by [personal profile] kareila.

Files modified:
  • bin/upgrading/en.dat
  • cgi-bin/ljprotocol.pl
  • cgi-bin/taglib.pl
--------------------------------------------------------------------------------
diff -r eef334d67be8 -r cdc29a206198 bin/upgrading/en.dat
--- a/bin/upgrading/en.dat	Sun Jun 28 01:47:04 2009 +0000
+++ b/bin/upgrading/en.dat	Sun Jun 28 03:35:57 2009 +0000
@@ -3373,6 +3373,8 @@ subscribe_interface.save=Save
 
 subscribe_interface.special_subs.note=These notification options are only available by email and will not show in your [[sitenameabbrev]] Inbox.
 
+taglib.error.access=You are not allowed to tag entries in this journal.
+
 taglib.error.invalid=The following tag name is invalid: [[tagname]]
 
 taglib.error.nomerge=The tag name '[[tagname]]' is already in use.  Merging tags is not supported at this time.
diff -r eef334d67be8 -r cdc29a206198 cgi-bin/ljprotocol.pl
--- a/cgi-bin/ljprotocol.pl	Sun Jun 28 01:47:04 2009 +0000
+++ b/cgi-bin/ljprotocol.pl	Sun Jun 28 03:35:57 2009 +0000
@@ -1434,7 +1434,7 @@ sub postevent
     }
 
     # Entry tags
-    if ($req->{props} && defined $req->{props}->{taglist}) {
+    if ( $req->{props} && defined $req->{props}->{taglist} && $req->{props}->{taglist} ne '' ) {
         # slightly misnamed, the taglist is/was normally a string, but now can also be an arrayref.
         my $taginput = $req->{props}->{taglist};
 
diff -r eef334d67be8 -r cdc29a206198 cgi-bin/taglib.pl
--- a/cgi-bin/taglib.pl	Sun Jun 28 01:47:04 2009 +0000
+++ b/cgi-bin/taglib.pl	Sun Jun 28 03:35:57 2009 +0000
@@ -704,7 +704,8 @@ sub update_logtags {
     my $can_add = $can_control || LJ::Tags::can_add_tags($u, $remote);
 
     # bail out early if we can't do any actions
-    return undef unless $can_add || $opts->{force};
+    return $err->( LJ::Lang::ml( 'taglib.error.access' ) )
+        unless $can_add || $opts->{force};
 
     # load the user's tags
     my $utags = LJ::Tags::get_usertags($u);
--------------------------------------------------------------------------------