Do not ask the admin to confirm the deletion of a custom field if it cannot be deleted

NEW
Unassigned

Status

()

Bugzilla
Administration
--
enhancement
5 years ago
5 years ago

People

(Reporter: Frédéric Buclin, Unassigned)

Tracking

Details

Attachments

(1 attachment)

2.78 KB, patch
Frédéric Buclin
: review-
Details | Diff | Splinter Review
(Reporter)

Description

5 years ago
When a custom field is marked as obsolete, you can click the "delete" link to delete this custom field. The confirmation page asks you if you are sure, and if you are, you get an error that this custom field cannot be deleted because there are entries in the bugs_activity table for this field. So it doesn't make sense to ask the admin if he is sure; the error message should be thrown immediately.

Comment 1

5 years ago
Created attachment 696801 [details] [diff] [review]
patch v1
Assignee: administration → koosha.khajeh
Status: NEW → ASSIGNED
Attachment #696801 - Flags: review?(LpSolit)
(Reporter)

Comment 2

5 years ago
Comment on attachment 696801 [details] [diff] [review]
patch v1

>+    ThrowUserError('customfield_has_contents', {'name' => $name }) if $field->has_bugs;

This check is not enough. If there has been any activity about this custom field, then the deletion is impossible.
Attachment #696801 - Flags: review?(LpSolit) → review-

Updated

5 years ago
Assignee: koosha.khajeh → administration
Status: ASSIGNED → NEW
You need to log in before you can comment on or make changes to this bug.