Closed Bug 282628 Opened 20 years ago Closed 19 years ago

Move OpenStates and IsOpenedState out of globals.pl

Categories

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

2.19.2
enhancement

Tracking

()

RESOLVED FIXED
Bugzilla 3.0

People

(Reporter: mkanat, Assigned: mkanat)

References

Details

Attachments

(1 file, 3 obsolete files)

IsOpenedState is in globals.pl, and nothing should be in globals.pl. :-)

Also, checksetup uses IsOpenedState, so we want to get it out of globals.pl so
we can remove globals.pl from checksetup.

I think that it will go in Bugzilla::Bug.
OpenStates should also go, because they're basically tied together and it's an
easy move. OpenStates will become a constant in Bugzilla::Constants.
Status: NEW → ASSIGNED
Summary: Move IsOpenedState out of globals.pl → Move OpenStates and IsOpenedState out of globals.pl
Priority: -- → P3
Target Milestone: --- → Bugzilla 2.22
Depends on: 282632
Attached patch v1 (obsolete) — Splinter Review
OK, here's the code that does it, but it currently breaks BugMail because of
BugMail's weird AUTOLOAD statement. So the AUTOLOAD has to go first, before we
can check this in.
Attachment #188896 - Flags: review?(wicked)
Depends on: 300334
Depends on: 300336
Comment on attachment 188896 [details] [diff] [review]
v1

First hunks in Bugzilla/Constant.pm and Bugzilla/BugMail.pm no longer apply.

Also, after fixing failures, runtests.pl no longer pass for Bugzilla/Bugmail.pm
compilation. Following errors:

[wicked@bugserv worktip]$ perl -cTwI. Bugzilla/BugMail.pm
[Tue Jul 19 11:54:27 2005] BugMail.pm: Subroutine FormatTriple redefined at
Bugzilla/BugMail.pm line 80.
[Tue Jul 19 11:54:27 2005] BugMail.pm: Subroutine FormatDouble redefined at
Bugzilla/BugMail.pm line 90.
[Tue Jul 19 11:54:27 2005] BugMail.pm: Subroutine Send redefined at
Bugzilla/BugMail.pm line 111.
[Tue Jul 19 11:54:27 2005] BugMail.pm: Subroutine ProcessOneBug redefined at
Bugzilla/BugMail.pm line 121.
[Tue Jul 19 11:54:27 2005] BugMail.pm: Subroutine sendMail redefined at
Bugzilla/BugMail.pm line 474.
[Tue Jul 19 11:54:27 2005] BugMail.pm: Subroutine MessageToMTA redefined at
Bugzilla/BugMail.pm line 608.
[Tue Jul 19 11:54:27 2005] BugMail.pm: Subroutine PerformSubsts redefined at
Bugzilla/BugMail.pm line 649.
[Tue Jul 19 11:54:27 2005] BugMail.pm: Subroutine MailPassword redefined at
Bugzilla/BugMail.pm line 656.
Content-type: text/html

<h1>Software error:</h1>
<pre>Not enough arguments for Bugzilla::BugMail::sendMail at
Bugzilla/BugMail.pm line 457, near &quot;$id)&quot;
Bugzilla/BugMail.pm had compilation errors.
</pre>
<p>
For help, please send mail to this site's webmaster, giving this error message
and the time and date of the error.

</p>
[Tue Jul 19 11:54:27 2005] BugMail.pm: Not enough arguments for
Bugzilla::BugMail::sendMail at Bugzilla/BugMail.pm line 457, near "$id)"
[Tue Jul 19 11:54:27 2005] BugMail.pm: Bugzilla/BugMail.pm had compilation
errors.

That error and redefinition warnings seem to happen because you added "use
Bugzilla::Bug;" which for some reason makes the perl enforce the parameter
number to call sendMail (only 11 passed when 12 expected).
Attachment #188896 - Flags: review?(wicked) → review-
Attached patch v2 (passes runtests) (obsolete) — Splinter Review
OK, this one passes runtests. I basically just updated the patch. I haven't done any hands-on testing, but I did run runtests.
Attachment #188896 - Attachment is obsolete: true
Attachment #202748 - Flags: review?(wicked)
Target Milestone: Bugzilla 2.22 → Bugzilla 2.24
Comment on attachment 202748 [details] [diff] [review]
v2 (passes runtests)

There's untouched IsOpenedState() in importxml.pl line 899 and OpenStates() in checksetup.pl line 4120.

>Index: checksetup.pl
>===================================================================
>+require Bugzilla::Bug;
>+import Bugzilla::Bug qw(is_open_state);

This change crashed checksetup run with:

"is_open_state" is not exported by the Bugzilla::Bug module
Can't continue after import errors at ./checksetup.pl line 1447

This is probably why some other scripts crash too when they try to use is_open_state sub.

>Index: editcomponents.cgi
>===================================================================

Nit: This no longer applies, but then again it's no longer needed because the line went away. :)
Attachment #202748 - Flags: review?(wicked) → review-
Attached patch v3 (obsolete) — Splinter Review
Okay, I fixed the patch based on wicked's comments. This one also passes runtests.
Attachment #202748 - Attachment is obsolete: true
Attachment #213021 - Flags: review?(wicked)
Comment on attachment 213021 [details] [diff] [review]
v3

/me notes that you add a dependency loop between Bug and BugMail. So probably bug 328449 should land first.
Depends on: 328449
Comment on attachment 213021 [details] [diff] [review]
v3

Oops, bitrotten because IsOpenedState call was moved from globals.pl to Bugzilla/Template.pm :(
Attachment #213021 - Flags: review?(wicked) → review-
Attached patch v4Splinter Review
Okay, I fixed the bitrot.
Attachment #213021 - Attachment is obsolete: true
Attachment #213936 - Flags: review?(wicked)
Comment on attachment 213936 [details] [diff] [review]
v4

>Index: config.cgi
>===================================================================

Failes because "use Bugzilla::Bug;" missing. Can be fixed on checkin (add after current use directives).

>Index: Bugzilla/Search.pm
>===================================================================

Same here.
Attachment #213936 - Flags: review?(wicked) → review+
Flags: approval?
Flags: approval? → approval+
Okay, did checkin fix.

Checking in buglist.cgi;
/cvsroot/mozilla/webtools/bugzilla/buglist.cgi,v  <--  buglist.cgi
new revision: 1.327; previous revision: 1.326
done
Checking in checksetup.pl;
/cvsroot/mozilla/webtools/bugzilla/checksetup.pl,v  <--  checksetup.pl
new revision: 1.475; previous revision: 1.474
done
Checking in config.cgi;
/cvsroot/mozilla/webtools/bugzilla/config.cgi,v  <--  config.cgi
new revision: 1.16; previous revision: 1.15
done
Checking in editproducts.cgi;
/cvsroot/mozilla/webtools/bugzilla/editproducts.cgi,v  <--  editproducts.cgi
new revision: 1.115; previous revision: 1.114
done
Checking in globals.pl;
/cvsroot/mozilla/webtools/bugzilla/globals.pl,v  <--  globals.pl
new revision: 1.357; previous revision: 1.356
done
Checking in importxml.pl;
/cvsroot/mozilla/webtools/bugzilla/importxml.pl,v  <--  importxml.pl
new revision: 1.49; previous revision: 1.48
done
Checking in process_bug.cgi;
/cvsroot/mozilla/webtools/bugzilla/process_bug.cgi,v  <--  process_bug.cgi
new revision: 1.308; previous revision: 1.307
done
Checking in sanitycheck.cgi;
/cvsroot/mozilla/webtools/bugzilla/sanitycheck.cgi,v  <--  sanitycheck.cgi
new revision: 1.111; previous revision: 1.110
done
Checking in showdependencygraph.cgi;
/cvsroot/mozilla/webtools/bugzilla/showdependencygraph.cgi,v  <--  showdependencygraph.cgi
new revision: 1.49; previous revision: 1.48
done
Checking in showdependencytree.cgi;
/cvsroot/mozilla/webtools/bugzilla/showdependencytree.cgi,v  <--  showdependencytree.cgi
new revision: 1.43; previous revision: 1.42
done
Checking in votes.cgi;
/cvsroot/mozilla/webtools/bugzilla/votes.cgi,v  <--  votes.cgi
new revision: 1.35; previous revision: 1.34
done
Checking in Bugzilla/Bug.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Bug.pm,v  <--  Bug.pm
new revision: 1.112; previous revision: 1.111
done
Checking in Bugzilla/BugMail.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/BugMail.pm,v  <--  BugMail.pm
new revision: 1.66; previous revision: 1.65
done
Checking in Bugzilla/Constants.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Constants.pm,v  <--  Constants.pm
new revision: 1.36; previous revision: 1.35
done
Checking in Bugzilla/Search.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Search.pm,v  <--  Search.pm
new revision: 1.122; previous revision: 1.121
done
Checking in Bugzilla/Template.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Template.pm,v  <--  Template.pm
new revision: 1.45; previous revision: 1.44
done
Checking in Bugzilla/Search/Quicksearch.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Search/Quicksearch.pm,v  <--  Quicksearch.pm
new revision: 1.3; previous revision: 1.2
done
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Blocks: 330186
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: