Closed
Bug 315605
Opened 19 years ago
Closed 19 years ago
Bugzilla::Field::check_form_field() should not take a CGI object as parameter
Categories
(Bugzilla :: Bugzilla-General, defect)
Tracking
()
RESOLVED
FIXED
Bugzilla 3.0
People
(Reporter: LpSolit, Assigned: LpSolit)
References
Details
Attachments
(1 file, 1 obsolete file)
11.63 KB,
patch
|
Details | Diff | Splinter Review |
When using non-cgi scripts, no CGI object is (or should be) available, and so we cannot use Bugzilla::Field::check_form_field*() to validate fields. These methods should accept a hash of the form {field_name => $field_value} instead of $cgi.
This problem appears at least in importxml.pl.
Comment 1•19 years ago
|
||
Instead of a hash, why not just check_field_defined($value, $fieldName)?
Assignee | ||
Updated•19 years ago
|
Assignee: general → LpSolit
Severity: enhancement → normal
Target Milestone: Bugzilla 2.24 → Bugzilla 2.22
Comment 2•19 years ago
|
||
Oh also, we should remove the word "form" from the function name, since it won't only be working on forms anymore.
Assignee | ||
Comment 3•19 years ago
|
||
I finally wrote ($name, $value, ...) instead of a hash, as suggested by mkanat.
Attachment #202321 -
Flags: review?(wurblzap)
Assignee | ||
Updated•19 years ago
|
Status: NEW → ASSIGNED
Summary: Bugzilla::Field::check_form_field*() should take a hash instead of a CGI object as parameter → Bugzilla::Field::check_form_field() should not take a CGI object as parameter
Assignee | ||
Updated•19 years ago
|
Attachment #202321 -
Flags: review?(wurblzap) → review?(wicked)
Comment 4•19 years ago
|
||
Comment on attachment 202321 [details] [diff] [review]
patch, v1
>Index: Bugzilla/Field.pm
>===================================================================
>-# Fr��ic Buclin <LpSolit@gmail.com>
>+# Frédéric Buclin <LpSolit@gmail.com>
This was a nasty change and made my patch attempt to fail for some reason. It took few hours but I finally got it to apply. :)
Otherwise this seems to change code logic nicely.
Attachment #202321 -
Flags: review?(wicked) → review+
Updated•19 years ago
|
Flags: approval?
Comment 5•19 years ago
|
||
This is too invasive to a critical procedure for 2.22 this close to release. Lets's check it in after we branch.
Target Milestone: Bugzilla 2.22 → Bugzilla 2.24
Updated•19 years ago
|
Flags: approval? → approval+
Assignee | ||
Comment 6•19 years ago
|
||
The patch has completely bitrotten due to custom fields. I will update it later this week.
Comment 7•19 years ago
|
||
Comment on attachment 202321 [details] [diff] [review]
patch, v1
FWIW, we were going to just move the check_form_field sub to CGI.pm... that would have worked, also.
Comment 8•19 years ago
|
||
(In reply to comment #7)
> (From update of attachment 202321 [details] [diff] [review] [edit])
> FWIW, we were going to just move the check_form_field sub to CGI.pm... that
> would have worked, also.
Oh, I see why you didn't do that. Okay :-)
Assignee | ||
Comment 9•19 years ago
|
||
The patch I'm checking in.
Attachment #202321 -
Attachment is obsolete: true
Assignee | ||
Comment 10•19 years ago
|
||
Checking in post_bug.cgi;
/cvsroot/mozilla/webtools/bugzilla/post_bug.cgi,v <-- post_bug.cgi
new revision: 1.136; previous revision: 1.135
done
Checking in process_bug.cgi;
/cvsroot/mozilla/webtools/bugzilla/process_bug.cgi,v <-- process_bug.cgi
new revision: 1.305; previous revision: 1.304
done
Checking in Bugzilla/Field.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Field.pm,v <-- Field.pm
new revision: 1.11; previous revision: 1.10
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.
Description
•