[livejournal] r19806: LJSV-1669 (db error when aplly new tag)
Committer: ailyin
LJSV-1669 (db error when aplly new tag)U trunk/cgi-bin/LJ/Support/Request/Tag.pm
Modified: trunk/cgi-bin/LJ/Support/Request/Tag.pm
===================================================================
--- trunk/cgi-bin/LJ/Support/Request/Tag.pm 2011-08-23 06:04:58 UTC (rev 19805)
+++ trunk/cgi-bin/LJ/Support/Request/Tag.pm 2011-08-23 06:26:28 UTC (rev 19806)
@@ -50,6 +50,7 @@
use strict;
use Encode qw(encode decode);
+use List::MoreUtils qw();
# get_requests_tags(): fetches information about which tags are assigned
# to the given requests; returns:
@@ -126,6 +127,7 @@
}
if (@tags_add) {
+ @tags_add = List::MoreUtils::uniq(@tags_add);
@tags_add = map { int $_ } @tags_add;
my @tags_add_exprs = map { "($spid,$_)" } @tags_add;
my $tags_add_exprs = join ',', @tags_add_exprs;
