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-06-14 06:42 pm

[dw-free] Creating new tags makes all tags disappear from an entry when tag limit exceeded

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

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

Handle tag errors gracefully when posting an entry.

Patch by [personal profile] kareila.

Files modified:
  • cgi-bin/ljprotocol.pl
--------------------------------------------------------------------------------
diff -r fbde25c78d1b -r 0532379eaa08 cgi-bin/ljprotocol.pl
--- a/cgi-bin/ljprotocol.pl	Sun Jun 14 18:35:44 2009 +0000
+++ b/cgi-bin/ljprotocol.pl	Sun Jun 14 18:42:44 2009 +0000
@@ -1438,9 +1438,11 @@ sub postevent
         # slightly misnamed, the taglist is/was normally a string, but now can also be an arrayref.
         my $taginput = $req->{props}->{taglist};
 
+        my $tagerr = "";
         my $logtag_opts = {
             remote => $u,
             ignore_max => $flags->{ignore_tags_max} ? 1 : 0,
+            err_ref => \$tagerr,
         };
 
         if (ref $taginput eq 'ARRAY') {
@@ -1451,6 +1453,7 @@ sub postevent
         }
 
         my $rv = LJ::Tags::update_logtags($uowner, $jitemid, $logtag_opts);
+        return fail($err,157,$tagerr) unless $rv;
     }
 
     # meta-data
--------------------------------------------------------------------------------

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