Open Bug 823636 Opened 12 years ago Updated 10 years ago

Remove the unused DEFAULT_CLASSIFICATION_ID constant

Categories

(Bugzilla :: Administration, task)

2.22
task
Not set
trivial

Tracking

()

ASSIGNED

People

(Reporter: LpSolit, Assigned: sjoshi)

References

Details

Attachments

(1 file)

DEFAULT_CLASSIFICATION_ID => 1 was defined in Product.pm to be used in the get_products_by_classification() subroutine, but this subroutine has been removed 7 years ago with the creation of the Bugzilla/Classification.pm module in Bugzilla 2.22, see bug 306601. So there is no code left which uses it. Bugzilla::Product::_check_classification() has a hardcoded default value set to 1, so we could either make it point to DEFAULT_CLASSIFICATION_ID or simply remove this constant. Note that the default classification ID is also hardcoded in Bugzilla/DB/Schema.pm in the products table for the classification_id column and is also set to 1. So technically, it wouldn't be necessary to set the default value at all in _check_classification(), except that it allows you to override the default value set in the DB schema.
Attached patch Patch-v1Splinter Review
Assignee: administration → joshi_sunil
Status: NEW → ASSIGNED
Attachment #8392876 - Flags: review?(dkl)
Comment on attachment 8392876 [details] [diff] [review]
Patch-v1

>-    my $classification_id = 1;

Did you test your patch? It's supposed to crash with this removal. This variable is still in use.
Attachment #8392876 - Flags: review?(dkl) → review-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: