Closed Bug 600123 Opened 12 years ago Closed 12 years ago

Eliminate Bugzilla::Bug's AUTOLOAD

Categories

(Bugzilla :: Bugzilla-General, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 4.2

People

(Reporter: mkanat, Assigned: mkanat)

References

Details

Attachments

(1 file, 1 obsolete file)

Bugzilla::Bug has an AUTOLOAD that tends to cause annoying problems. We should define all of the basic accessors as normal subroutines, and minimize the use of AUTOLOAD.
Blocks: 588483
Attached patch v1 (obsolete) — Splinter Review
I was fully able to eliminate the AUTOLOAD, by automatically creating the custom field accessors the first time that a Bug object is created.

We have to run it once on every request, even in mod_perl, because the list of custom fields might have changed.

This will cause one behavior change--we will now start returning "undef" instead of an empty string for values that are NULL in the database. In my view, this is something that we definitely *want* to be doing, so it's not bad.

In my brief testing, this works fine.
Assignee: general → mkanat
Status: NEW → ASSIGNED
Attachment #478975 - Flags: review?(glob)
Ah, bug 330717...
(In reply to comment #2)
> Ah, bug 330717...

  Ah, I *thought* we had a bug for that! I didn't search for closed bugs, of course. :-) Maybe it should be duped here, now that this bug has a patch?
Attached patch v2Splinter Review
glob pointed out on IRC that I forgot to add a "version" accessor.
Attachment #478975 - Attachment is obsolete: true
Attachment #480069 - Flags: review?(glob)
Attachment #478975 - Flags: review?(glob)
Comment on attachment 480069 [details] [diff] [review]
v2

r=glob
Attachment #480069 - Flags: review?(glob) → review+
Flags: approval+
Summary: Eliminate Bugzilla::Bug's AUTOLOAD as much as possible → Eliminate Bugzilla::Bug's AUTOLOAD
Wooo hooo!! Bye-bye, AUTOLOAD!!

Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/trunk/                       
modified Bugzilla/Bug.pm
Committed revision 7497.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.