Closed Bug 95747 Opened 23 years ago Closed 20 years ago

typoed CC fails to abort before changes are made

Categories

(Bugzilla :: Bugzilla-General, defect, P1)

Tracking

()

RESOLVED FIXED
Bugzilla 2.14

People

(Reporter: justdave, Assigned: jacob)

Details

Attachments

(1 file)

when adding a CC to a bug, if you typo an address, it tells you "this@address
isn't a bugzilla user.  Press Back and try again".  If you press back, and
correct your address, when you hit commit, it midairs, because the rest of the
changes you made to the bug applied anyway (but it didn't tell you they did).

The CC name to ID check needs to be run on the CC addresses before any changes
are written to the database.
b.m.o shakedown
Priority: -- → P1
Target Milestone: --- → Bugzilla 2.14
What this patch does is moves part of the CC processing code out of the $id
loop.  This makes it so it can be run through DBIdToNameAndCheck() *before*
doing the other stuff with the bug [which is what it did before I broke it in
bug 55161 :( ].  Rather than processing everything twice, it sets up a hash of
what changes are requested outside the loop, then inside the loop it makes those
changes (if needed).

I also moved the declaration of my $removedCcString inside the loop so it has
the same scope of the processmail call (rather than global to the file).  This
hasn't caused any problems yet, but with the CC changes available on the mass
change page now (bug 12819) there's some possibilites.
Assignee: justdave → jake
Keywords: patch, review
Oops... the patch has a stray # XXXXXX that I used to mark my place :(
Harmless, but not needed.
The patch looks good and works on my test installation, r=myk.

I like this approach (validate all data before committing any of it) a lot. 
Also, I couldn't find any problems with $removedCcString's new location.  It
looks like you have it in the right place.

Commited.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Moving to Bugzilla product
Component: Bugzilla → Bugzilla-General
Product: Webtools → Bugzilla
Version: Bugzilla 2.13 → unspecified
Jake - is there any way you can change this patch in such a way so that we don't
have two variables named cc_add - one hash and one scalar?  The same request for
cc_remove?  I'd like to see %cc_add renamed to %cc_add_list and %cc_removed to
%cc_removed_list.  That way, people who are reading this code won't get confused
as easily as I have.  If not, maybe we should consider opening a new bug to
rename those variables...  I know that Perl makes the distinction without any
problems, but I'm prone to mistaking one for the other.  I'm sure others may be
as well.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
What you request is something new, so please open a new bug for that. We won't
back out a patch which landed almost 4 years ago.
Status: REOPENED → RESOLVED
Closed: 23 years ago20 years ago
Resolution: --- → FIXED
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: