Closed Bug 349555 Opened 18 years ago Closed 18 years ago

Move dependency validation from post_bug into Bugzilla::Bug

Categories

(Bugzilla :: Creating/Changing Bugs, 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)

3.80 KB, patch
bugzilla-mozilla
: review+
Details | Diff | Splinter Review
This is another in the series of "move validations into Bug.pm" bugs. This time it's for the "blocked" and "dependson" fields.
Attached patch v1 (obsolete) — Splinter Review
Okay, here it is! I've tested bug filing, and it all behaves properly. Changing bugs also still behaves properly.
Assignee: create-and-change → mkanat
Status: NEW → ASSIGNED
Attachment #234822 - Flags: review?(bugzilla-mozilla)
Blocks: 349561
Blocks: 349741
Comment on attachment 234822 [details] [diff] [review]
v1

>Index: Bugzilla/Bug.pm

>@@ -349,6 +349,32 @@
>     return [keys %keyword_ids];
> }
> 
>+# Takes two comma/space-separated strings and returns arrayrefs
>+# of valid bug IDs.
>+sub _check_dependencies {
>+    my ($depends_on, $blocks) = @_;
>+
>+    # Only editbugs users can set dependencies on bug entry.
>+    return ([], []) unless Bugzilla->user->in_group('editbugs');
>+
>+    # Make sure all the bug_ids are valid.
>+    my @results;
>+    foreach my $string ($depends_on, $blocks) {
>+        my @array = split(/[\s,]+/, $string);

Those strings can be undef:

[Tue Aug 22 23:15:49 2006] [error] [client 127.0.0.1] [Tue Aug 22 23:15:49 2006] post_bug.cgi: Use of uninitialized value in split at Bugzilla/Bug.pm line 363.
[Tue Aug 22 23:15:49 2006] [error] [client 127.0.0.1] [Tue Aug 22 23:15:49 2006] post_bug.cgi: Use of uninitialized value in split at Bugzilla/Bug.pm line 363.

Looks good reading through it otherwise.
Attachment #234822 - Flags: review?(bugzilla-mozilla) → review-
Attached patch v2Splinter Review
Okay, this handles that.
Attachment #234822 - Attachment is obsolete: true
Attachment #234982 - Flags: review?(bugzilla-mozilla)
Attachment #234982 - Flags: review?(bugzilla-mozilla) → review+
Flags: approval?
No longer blocks: 349561
Flags: approval? → approval+
Checking in post_bug.cgi;
/cvsroot/mozilla/webtools/bugzilla/post_bug.cgi,v  <--  post_bug.cgi
new revision: 1.168; previous revision: 1.167
done
Checking in Bugzilla/Bug.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Bug.pm,v  <--  Bug.pm
new revision: 1.142; previous revision: 1.141
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: