Instead of telling us that we've exceeded the maximum number of tags,
state how many extra we have, and list the new tags on this entry.
Patch by Erin of <user name="teamdestroyer">.
diffs (43 lines):
diff -r aa7e846f2689 -r af4fb7de068f bin/upgrading/en.dat
--- a/bin/upgrading/en.dat Fri Dec 17 01:04:29 2010 +0800
+++ b/bin/upgrading/en.dat Fri Dec 17 01:20:43 2010 +0800
@@ -3786,7 +3786,7 @@ taglib.error.mergenoname=You did not pro
taglib.error.mergetoexisting=The tag name '[[tagname]]' is already in use, but
you did not select it. Please select the tag or merge to a different tag name.
-taglib.error.toomany=This would make you exceed your maximum of [[max]] tags.
Please remove some and try again.
+taglib.error.toomany=This would make you exceed your maximum of [[max]] tags.
Please remove at least [[excess]] of the following new tags: [[tags]].
talk.anonwrote=Someone wrote,
diff -r aa7e846f2689 -r af4fb7de068f cgi-bin/LJ/Tags.pm
--- a/cgi-bin/LJ/Tags.pm Fri Dec 17 01:04:29 2010 +0800
+++ b/cgi-bin/LJ/Tags.pm Fri Dec 17 01:20:43 2010 +0800
@@ -833,7 +833,11 @@ sub update_logtags {
my $max = $opts->{ignore_max} ? 0 : $u->count_tags_max;
if (@to_create && $max && $max > 0) {
my $total = scalar(keys %$utags) + scalar(@to_create);
- return $err->(LJ::Lang::ml('taglib.error.toomany', { max => $max }))
if $total > $max;
+ if ( $total > $max ) {
+ return $err->(LJ::Lang::ml('taglib.error.toomany', { max => $max,
+ tags =>
join(", ", @to_create),
+ excess =>
$total - $max }));
+ }
}
# now we can create the new tags, since we know we're safe
@@ -1102,8 +1106,12 @@ sub create_usertag {
my $max = $opts->{ignore_max} ? 0 : $u->count_tags_max;
if ($max && $max > 0) {
my $cur = scalar(keys %{ LJ::Tags::get_usertags($u) || {} });
- return $err->(LJ::Lang::ml('taglib.error.toomany', { max => $max }))
- if $cur + scalar(@$tags) > $max;
+ my $tagtotal = $cur + scalar(@$tags);
+ if ($tagtotal > $max) {
+ return $err->(LJ::Lang::ml('taglib.error.toomany', { max => $max,
+ tags =>
join(", ", @$tags) ,
+ excess =>
$tagtotal - $max }));
+ }
}
my $display = $opts->{display} ? 1 : 0;
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog