Closed Bug 282090 Opened 20 years ago Closed 19 years ago

Eliminate %classdesc in favor of Bugzilla::Classification methods

Categories

(Bugzilla :: Bugzilla-General, enhancement, P2)

2.19.2
enhancement

Tracking

()

RESOLVED FIXED
Bugzilla 2.22

People

(Reporter: mkanat, Assigned: mkanat)

References

Details

Attachments

(1 file, 1 obsolete file)

Instead of being a global variable, %classifications should come out of a
subroutine in Bugzilla::Classification (which is a new module).
Depends on: 280122
Priority: -- → P2
Target Milestone: --- → Bugzilla 2.22
Depends on: 294160
No longer depends on: 280122
Summary: Move %classifications to Bugzilla::BugClass → Move %classifications to Bugzilla::Classification
Summary: Move %classifications to Bugzilla::Classification → Move %classifications and %classdesc to Bugzilla::Classification
OK, instead, let's just get rid of them and use methods from the new
Bugzilla::Classification instead.
Summary: Move %classifications and %classdesc to Bugzilla::Classification → Eliminate %classifications and %classdesc in favor of Bugzilla::Classification methods
Depends on: 300232
OK, let's just do one variable at a time, it's easiest that way. It's really,
really easy to eliminate classdesc at this point, so I'm going to do that.
Summary: Eliminate %classifications and %classdesc in favor of Bugzilla::Classification methods → Eliminate %classdesc in favor of Bugzilla::Classification methods
Attached patch v1 (obsolete) (deleted) β€” β€” Splinter Review
Apparently only enter_bug.cgi was using classdesc, so this patch is nice and
small. I've tested it with useclassification on and off, and it works both
ways.
Attachment #198641 - Flags: review?(wicked)
Comment on attachment 198641 [details] [diff] [review]
v1

>Index: enter_bug.cgi
>===================================================================
>@@ -76,7 +77,9 @@
> 
>    if ( ! Param('useclassification') ) {
>       # just pick the default one
>-      $cgi->param(-name => 'classification', -value => (keys %::classdesc)[0]);
>+      my $default_classification = new Bugzilla::Classification(
>+          Bugzilla::Product::DEFAULT_CLASSIFICATION_ID);
>+      $cgi->param(-name => 'classification', -value => $default_classification->name);

Nit: Is there any reason why this shouldn't just set classification param to
__all? That way there's no unnecessary DB access. Code already shows all
products regardles of classification if useclassification is not defined.

Otherwise this seems to work, r=wicked. I also tested with a line 
 $cgi->param(-name => 'classification', -value => '__all');
so that should work too. You can carry forward my r+ if you just change that
line (and comment) to fix my nit.
Attachment #198641 - Flags: review?(wicked) → review+
I think I'd like to leave it as it is for now, and then when we get around to
removing the "useclassification" param, we can get rid of that line, also.
Status: NEW → ASSIGNED
Flags: approval?
Comment on attachment 198641 [details] [diff] [review]
v1

bitrotten!
Flags: approval? → approval+
Attached patch v2 (deleted) β€” β€” Splinter Review
OK, because I hit bitrot in the area wicked commented on, I used his fix as the
simplest solution. This also allowed me to remove the "use Bugzilla::Product"
and "use Bugzilla::Classification" from enter_bug.cgi.
Attachment #198641 - Attachment is obsolete: true
Attachment #199211 - Flags: review+
Checking in enter_bug.cgi;
/cvsroot/mozilla/webtools/bugzilla/enter_bug.cgi,v  <--  enter_bug.cgi
new revision: 1.121; previous revision: 1.120
done
Checking in globals.pl;
/cvsroot/mozilla/webtools/bugzilla/globals.pl,v  <--  globals.pl
new revision: 1.341; previous revision: 1.340
done
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: