From 06779036db44ec799fee99173015c5349eb80c92 Mon Sep 17 00:00:00 2001 From: Simon Green Date: Sun, 30 Oct 2016 14:53:25 +1000 Subject: Bug 331007 - alias_in_use doesn't acknowledge that you could remove the alias from the other bug --- Bugzilla/Bug.pm | 2 +- template/en/default/global/user-error.html.tmpl | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index a41e4f1aa..46b16ffd6 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -1445,7 +1445,7 @@ sub _check_alias { && (!ref $invocant || $other_bug->id != $invocant->id)) { ThrowUserError("alias_in_use", { alias => $alias, - bug_id => $other_bug->id }); + other_bug => $other_bug }); } } diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index d1724635a..2bbc07bc9 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -79,13 +79,14 @@ [% ELSIF error == "alias_in_use" %] [% title = "Alias In Use" %] - [% IF user.can_see_bug(bug_id) %] - [% terms.Bug %] [%+ bug_id FILTER bug_link(bug_id) FILTER none %] + [% IF user.can_see_bug(other_bug.id) %] + [% terms.Bug %] [%+ other_bug.id FILTER bug_link(other_bug.bug_id) FILTER none %] + is currently using the alias [% alias FILTER html %]. + Please choose another alias[% IF other_bug.check_can_change_field('alias', 0, 1) %] or visit that [% terms.bug %] and change its alias[% END %]. [% ELSE %] - Another [% terms.bug %] + The alias [% alias FILTER html %] is already used by another + [% terms.bug %] you are not allowed to see. Please choose another alias. [% END %] - has already taken the alias [% alias FILTER html %]. - Please choose another alias. [% ELSIF error == "alias_is_numeric" %] [% title = "Alias Is Numeric" %] -- cgit v1.2.3-24-g4f1b