Last Comment Bug 577054 - Cannot delete any field value if that value's field controls any values
: Cannot delete any field value if that value's field controls any values
Status: RESOLVED FIXED
:
Product: Bugzilla
Classification: Server Software
Component: Administration (show other bugs)
: 3.4
: All All
: -- normal (vote)
: Bugzilla 3.6
Assigned To: Max Kanat-Alexander
: default-qa
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-07-05 21:30 PDT by Max Kanat-Alexander
Modified: 2010-07-22 18:36 PDT (History)
0 users
LpSolit: approval+
LpSolit: approval4.0+
mkanat: blocking4.0+
LpSolit: approval3.6+
mkanat: blocking3.6.2+
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
v1 (1.84 KB, patch)
2010-07-05 21:43 PDT, Max Kanat-Alexander
LpSolit: review+
Details | Diff | Splinter Review
v1 (3.6) (1.79 KB, patch)
2010-07-22 05:12 PDT, Max Kanat-Alexander
LpSolit: review+
Details | Diff | Splinter Review

Description Max Kanat-Alexander 2010-07-05 21:30:24 PDT
Situation:

Field A is a value controller.
Field A has Value 1 that doesn't control any values.
You try to delete Value 1, and Bugzilla will throw an error that you can't delete it, because it controls (empty list of values).
Comment 1 Max Kanat-Alexander 2010-07-05 21:31:10 PDT
This proves that either people don't use value controllers much, or that they don't delete field values very often. (More likely the latter.) The reason I say this is that this bug has been around for pretty much as long as we've had value controllers, and nobody's reported it.
Comment 2 Max Kanat-Alexander 2010-07-05 21:43:15 PDT
Created attachment 456138 [details] [diff] [review]
v1

Okay, this applies to HEAD at least. I'm not sure if it will also apply to 3.6--I forget when I split things out into ChoiceInterface.
Comment 3 Frédéric Buclin 2010-07-21 13:22:34 PDT
Comment on attachment 456138 [details] [diff] [review]
v1

r=LpSolit
Comment 4 Frédéric Buclin 2010-07-21 13:23:18 PDT
Bugzilla/Field/ChoiceInterface.pm doesn't exist in 3.6.1.
Comment 5 Max Kanat-Alexander 2010-07-22 05:12:50 PDT
Created attachment 459398 [details] [diff] [review]
v1 (3.6)

Okay, I haven't tested this (I have to go to sleep right now, and setting up a testing environment was taking too long) but it compiles and it's basically just a straightforward backport. All I did was copy identical code into the right place.
Comment 6 Frédéric Buclin 2010-07-22 07:04:26 PDT
Comment on attachment 459398 [details] [diff] [review]
v1 (3.6)

Works fine. r=LpSolit
Comment 7 Max Kanat-Alexander 2010-07-22 18:36:50 PDT
Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/trunk/
modified Bugzilla/Field/ChoiceInterface.pm
modified template/en/default/admin/fieldvalues/confirm-delete.html.tmpl
Committed revision 7396.

Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/4.0/
modified Bugzilla/Field/ChoiceInterface.pm
modified template/en/default/admin/fieldvalues/confirm-delete.html.tmpl
Committed revision 7340.

Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/3.6/
modified Bugzilla/Field/Choice.pm
modified template/en/default/admin/fieldvalues/confirm-delete.html.tmpl
Committed revision 7143.

Note You need to log in before you can comment on or make changes to this bug.