Closed Bug 567296 Opened 14 years ago Closed 14 years ago

Bugzilla::Bug should use VALIDATOR_DEPENDENCIES instead of UPDATE_VALIDATORS

Categories

(Bugzilla :: Creating/Changing Bugs, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 4.0

People

(Reporter: mkanat, Assigned: mkanat)

References

Details

Attachments

(1 file, 2 obsolete files)

Most or all of Bugzilla::Bug's run_create_validators can be replaced with the VALIDATOR_DEPENDENCIES system.
Attached patch Work In Progress (obsolete) — Splinter Review
Assignee: create-and-change → mkanat
Status: NEW → ASSIGNED
Depends on: 567303
Attached patch v1 (obsolete) — Splinter Review
Here we go!

Custom fields go into VALIDATOR_DEPENDENCIES because of the is_mandatory checks, so that fields are set in the proper order during set_all.
Attachment #446655 - Attachment is obsolete: true
Attachment #446910 - Flags: review?(LpSolit)
Attachment #446910 - Flags: review?(LpSolit) → review?(dkl)
Blocks: 567846
SQL error when creating a new bug:

[Thu Jun 03 00:40:28 2010] [error] DBD::mysql::db do failed: Column 'component_id' cannot be null [for Statement "INSERT INTO bugs (priority, reporter, bug_file_loc, product_id, rep_platform, assigned_to, everconfirmed, qa_contact, short_desc, status_whiteboard, bug_severity, bug_status, delta_ts, version, deadline, estimated_time, component_id, target_milestone, alias, op_sys) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"] at /var/www/html/bugzilla/Bugzilla/Object.pm line 496\n\tBugzilla::Object::insert_create_data('Bugzilla::Bug', 'HASH(0x7f42405ac848)') called at /var/www/html/bugzilla/Bugzilla/Bug.pm line 522\n\tBugzilla::Bug::create('Bugzilla::Bug', 'HASH(0x7f424228ee50)') called at /var/www/html/bugzilla/post_bug.cgi line 164\n\tModPerl::ROOT::Bugzilla::ModPerl::ResponseHandler::var_www_html_bugzilla_post_bug_2ecgi::handler('Apache2::RequestRec=SCALAR(0x7f42427c87f8)') called at /usr/lib64/perl5/ModPerl/RegistryCooker.pm line 204\n\teval {...} called at /usr/lib64/perl5/ModPerl/RegistryCooker.pm line 204\n\tModPerl::RegistryCooker::run('Bugzilla::ModPerl::ResponseHandler=HASH(0x7f4243487900)') called at /usr/lib64/perl5/ModPerl/RegistryCooker.pm line 170\n\tModPerl::RegistryCooker::default_handler('Bugzilla::ModPerl::ResponseHandler=HASH(0x7f4243487900)') called at /usr/lib64/perl5/ModPerl/Registry.pm line 31\n\tModPerl::Registry::handler('Bugzilla::ModPerl::ResponseHandler', 'Apache2::RequestRec=SCALAR(0x7f42427c87f8)') called at /var/www/html/bugzilla/mod_perl.pl line 115\n\tBugzilla::ModPerl::ResponseHandler::handler('Bugzilla::ModPerl::ResponseHandler', 'Apache2::RequestRec=SCALAR(0x7f42427c87f8)') called at -e line 0\n\teval {...} called at -e line 0\n

The error is coming from:

+    my $component = delete $params->{component};
+    $params->{component_id} = $params->{component};

Should be:

+    my $component = delete $params->{component};
+    $params->{component_id} = $component->id;
Comment on attachment 446910 [details] [diff] [review]
v1

See comment 3
Attachment #446910 - Flags: review?(dkl) → review-
Attached patch v2Splinter Review
Ah, thanks! Here's a patch with that fixed.
Attachment #446910 - Attachment is obsolete: true
Attachment #449004 - Flags: review?(dkl)
Comment on attachment 449004 [details] [diff] [review]
v2

Code looks good and all my testing was successful. r=dkl
Attachment #449004 - Flags: review?(dkl) → review+
Flags: approval?
Flags: approval? → approval+
Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/trunk/
modified Bugzilla/Bug.pm
Committed revision 7205.
Status: ASSIGNED → RESOLVED
Closed: 14 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: