Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Ivlev
bugzilla
Commits
fe879a3d
Commit
fe879a3d
authored
Oct 25, 2004
by
justdave%bugzilla.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 254498: Check for comment required for time validation was too late.
Patch by Tiago R. Mello <tiago@async.com.br> r=kiko, a=justdave
parent
77c85a80
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
32 deletions
+36
-32
process_bug.cgi
process_bug.cgi
+36
-32
No files found.
process_bug.cgi
View file @
fe879a3d
...
...
@@ -100,39 +100,15 @@ foreach my $field ("estimated_time", "work_time", "remaining_time") {
}
}
# do a match on the fields if applicable
# The order of these function calls is important, as both Flag::validate
# and FlagType::validate assume User::match_field has ensured that the values
# in the requestee fields are legitimate user email addresses.
&
Bugzilla::User::
match_field
({
'qa_contact'
=>
{
'type'
=>
'single'
},
'newcc'
=>
{
'type'
=>
'multi'
},
'masscc'
=>
{
'type'
=>
'multi'
},
'assigned_to'
=>
{
'type'
=>
'single'
},
'^requestee(_type)?-(\d+)$'
=>
{
'type'
=>
'single'
},
});
# Validate flags, but only if the user is changing a single bug,
# since the multi-change form doesn't include flag changes.
if
(
defined
$::FORM
{
'id'
})
{
Bugzilla::Flag::
validate
(
\%::
FORM
,
$::FORM
{
'id'
});
Bugzilla::FlagType::
validate
(
\%::
FORM
,
$::FORM
{
'id'
});
}
# If we are duping bugs, let's also make sure that we can change
# the original. This takes care of issue A on bug 96085.
if
(
defined
$::FORM
{
'dup_id'
}
&&
$::FORM
{
'knob'
}
eq
"duplicate"
)
{
ValidateBugID
(
$::FORM
{
'dup_id'
});
# Also, let's see if the reporter has authorization to see the bug
# to which we are duping. If not we need to prompt.
DuplicateUserConfirm
();
if
(
UserInGroup
(
Param
(
'timetrackinggroup'
)))
{
my
$wk_time
=
$::FORM
{
'work_time'
};
if
(
$::FORM
{
'comment'
}
=~
/^\s*$/
&&
$wk_time
&&
$wk_time
!=
0
)
{
ThrowUserError
(
'comment_required'
,
undef
,
"abort"
);
}
}
ValidateComment
(
$::FORM
{
'comment'
});
$::FORM
{
'dontchange'
}
=
''
unless
exists
$::FORM
{
'dontchange'
};
# If the bug(s) being modified have dependencies, validate them
# and rebuild the list with the validated values. This is important
# because there are situations where validation changes the value
...
...
@@ -151,6 +127,37 @@ foreach my $field ("dependson", "blocked") {
}
}
# If we are duping bugs, let's also make sure that we can change
# the original. This takes care of issue A on bug 96085.
if
(
defined
$::FORM
{
'dup_id'
}
&&
$::FORM
{
'knob'
}
eq
"duplicate"
)
{
ValidateBugID
(
$::FORM
{
'dup_id'
});
# Also, let's see if the reporter has authorization to see the bug
# to which we are duping. If not we need to prompt.
DuplicateUserConfirm
();
}
# do a match on the fields if applicable
# The order of these function calls is important, as both Flag::validate
# and FlagType::validate assume User::match_field has ensured that the values
# in the requestee fields are legitimate user email addresses.
&
Bugzilla::User::
match_field
({
'qa_contact'
=>
{
'type'
=>
'single'
},
'newcc'
=>
{
'type'
=>
'multi'
},
'masscc'
=>
{
'type'
=>
'multi'
},
'assigned_to'
=>
{
'type'
=>
'single'
},
'^requestee(_type)?-(\d+)$'
=>
{
'type'
=>
'single'
},
});
# Validate flags, but only if the user is changing a single bug,
# since the multi-change form doesn't include flag changes.
if
(
defined
$::FORM
{
'id'
})
{
Bugzilla::Flag::
validate
(
\%::
FORM
,
$::FORM
{
'id'
});
Bugzilla::FlagType::
validate
(
\%::
FORM
,
$::FORM
{
'id'
});
}
$::FORM
{
'dontchange'
}
=
''
unless
exists
$::FORM
{
'dontchange'
};
######################################################################
# End Data/Security Validation
######################################################################
...
...
@@ -1290,9 +1297,6 @@ foreach my $id (@idlist) {
if
(
UserInGroup
(
Param
(
'timetrackinggroup'
)))
{
$work_time
=
$::FORM
{
'work_time'
};
if
(
$work_time
)
{
if
(
!
defined
$::FORM
{
'comment'
}
||
$::FORM
{
'comment'
}
=~
/^\s*$/
)
{
ThrowUserError
(
'comment_required'
,
undef
,
"abort"
);
}
# AppendComment (called below) can in theory raise an error,
# but because we've already validated work_time here it's
# safe to log the entry before adding the comment.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment