Closed Bug 339382 Opened 19 years ago Closed 18 years ago

Make Bugzilla::Field use Bugzilla::Object

Categories

(Bugzilla :: Bugzilla-General, enhancement)

2.23
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 3.0

People

(Reporter: mkanat, Assigned: mkanat)

References

Details

Attachments

(1 file, 1 obsolete file)

This one is slightly more tricky, since currently Bugzilla::Field::new always uses the name of the field, and never the id. So we'll have to change all of the calling code.
Attached patch v1 (obsolete) — Splinter Review
Okay, I think this bug would make some of my custom field work easier, so I'm going to do it here.
Assignee: general → mkanat
Status: NEW → ASSIGNED
Attachment #229764 - Flags: review?(LpSolit)
Comment on attachment 229764 [details] [diff] [review] v1 >Index: checksetup.pl At line 2116, you forgot the following line: $id = $dbh->bz_last_key('fielddefs', 'fieldid'); >@@ -3083,7 +3087,7 @@ >- "SELECT fieldid FROM fielddefs WHERE name='attachstatusdefs.name'") >+ "SELECT id FROM fielddefs WHERE name='attachstatusdefs.name'") > || 0; > > $sth = $dbh->prepare("SELECT fieldid FROM fielddefs " . Oops! You forgot to fix this last line too. >Index: Bugzilla/Field.pm > sub match { >+ my $ids = Bugzilla->dbh->selectcol_arrayref( >+ "SELECT id FROM fielddefs $where ORDER BY sortkey", >+ {Slice => {}}); Nit: ORDER BY is useless as new_from_list() will order fields itself. Maybe the SQL query would be a little bit faster with ORDER BY removed. You also forgot to fix the following line in Field::check_field(): my $field = new Bugzilla::Field($name);
Attachment #229764 - Flags: review?(LpSolit) → review-
Attached patch v2Splinter Review
Ah, thanks for catching all that. :-) Here's a revised version, with just your comments fixed.
Attachment #229764 - Attachment is obsolete: true
Attachment #230644 - Flags: review?(LpSolit)
Comment on attachment 230644 [details] [diff] [review] v2 works fine. r=LpSolit
Attachment #230644 - Flags: review?(LpSolit) → review+
Flags: approval?
Flags: approval? → approval+
Checking in Bugzilla.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla.pm,v <-- Bugzilla.pm new revision: 1.42; previous revision: 1.41 done Checking in checksetup.pl; /cvsroot/mozilla/webtools/bugzilla/checksetup.pl,v <-- checksetup.pl new revision: 1.514; previous revision: 1.513 done Checking in collectstats.pl; /cvsroot/mozilla/webtools/bugzilla/collectstats.pl,v <-- collectstats.pl new revision: 1.56; previous revision: 1.55 done Checking in customfield.pl; /cvsroot/mozilla/webtools/bugzilla/customfield.pl,v <-- customfield.pl new revision: 1.6; previous revision: 1.5 done Checking in editusers.cgi; /cvsroot/mozilla/webtools/bugzilla/editusers.cgi,v <-- editusers.cgi new revision: 1.127; previous revision: 1.126 done Checking in sanitycheck.cgi; /cvsroot/mozilla/webtools/bugzilla/sanitycheck.cgi,v <-- sanitycheck.cgi new revision: 1.120; previous revision: 1.119 done Checking in Bugzilla/Bug.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Bug.pm,v <-- Bug.pm new revision: 1.129; previous revision: 1.128 done Checking in Bugzilla/BugMail.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/BugMail.pm,v <-- BugMail.pm new revision: 1.85; previous revision: 1.84 done Checking in Bugzilla/Field.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Field.pm,v <-- Field.pm new revision: 1.14; previous revision: 1.13 done Checking in Bugzilla/Search.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Search.pm,v <-- Search.pm new revision: 1.134; previous revision: 1.133 done Checking in Bugzilla/DB/Schema.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/DB/Schema.pm,v <-- Schema.pm new revision: 1.56; previous revision: 1.55 done
Status: ASSIGNED → RESOLVED
Closed: 18 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: