Skip to content

Commit

Permalink
Add field name when summary/description are missing on reporting/upda…
Browse files Browse the repository at this point in the history
…ting issues.

git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@2648 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
vboctor committed Jul 7, 2004
1 parent 4b8efde commit b88c721
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions core/bug_api.php
Expand Up @@ -6,7 +6,7 @@
# See the README and LICENSE files for details

# --------------------------------------------------------
# $Id: bug_api.php,v 1.65 2004-06-29 07:05:59 int2str Exp $
# $Id: bug_api.php,v 1.66 2004-07-07 12:01:02 vboctor Exp $
# --------------------------------------------------------

$t_core_dir = dirname( __FILE__ ).DIRECTORY_SEPARATOR;
Expand Down Expand Up @@ -296,8 +296,15 @@ function bug_create( $p_project_id,
$c_additional_info = db_prepare_string( $p_additional_info );
$c_sponsorship_total = 0;

# Summary and description cannot be blank
if ( is_blank( $c_summary ) || is_blank( $c_description ) ) {
# Summary cannot be blank
if ( is_blank( $c_summary ) ) {
error_parameters( lang_get( 'summary' ) );
trigger_error( ERROR_EMPTY_FIELD, ERROR );
}

# Description cannot be blank
if ( is_blank( $c_description ) ) {
error_parameters( lang_get( 'description' ) );
trigger_error( ERROR_EMPTY_FIELD, ERROR );
}

Expand Down Expand Up @@ -654,14 +661,16 @@ function bug_update( $p_bug_id, $p_bug_data, $p_update_extended = false ) {
$c_bug_id = db_prepare_int( $p_bug_id );
$c_bug_data = bug_prepare_db( $p_bug_data );

# Summary field cannot be empty
# Summary cannot be blank
if ( is_blank( $c_bug_data->summary ) ) {
error_parameters( lang_get( 'summary' ) );
trigger_error( ERROR_EMPTY_FIELD, ERROR );
}

if ( $p_update_extended ) {
# Description field cannot be empty
if ( is_blank( $c_bug_data->description ) ) {
error_parameters( lang_get( 'description' ) );
trigger_error( ERROR_EMPTY_FIELD, ERROR );
}
}
Expand Down

0 comments on commit b88c721

Please sign in to comment.