Hi,
I am using Mantis 1.2.4.
When reporting a bug we don't want the description field to be mandatory. How can i do that?
Thanks for any help.
Mamtha
How to make a field not mandatory
Moderators: Developer, Contributor
Re: How to make a field not mandatory
This is not possible by customizing a parameter.
You would have to change the source code to get this.
But I am not sure if all of the source code of MantisBT will be able to deal with empty descriptions.
As a workaround you could write a plugin which fills the description field if it's empty (maybe duplicates the summary)
You would have to change the source code to get this.
But I am not sure if all of the source code of MantisBT will be able to deal with empty descriptions.
As a workaround you could write a plugin which fills the description field if it's empty (maybe duplicates the summary)
Re: How to make a field not mandatory
in core\bug_api.php you will find (line 272):
change it into:
That may do the trick 
Code: Select all
if( $p_update_extended ) {
# Description field cannot be empty
if( is_blank( $this->description ) ) {
error_parameters( lang_get( 'description' ) );
trigger_error( ERROR_EMPTY_FIELD, ERROR );
}
}
Code: Select all
if( $p_update_extended ) {
# Description field cannot be empty
if( is_blank( $this->description ) ) {
// error_parameters( lang_get( 'description' ) );
// trigger_error( ERROR_EMPTY_FIELD, ERROR );
}
}

Re: How to make a field not mandatory
Hi Cas, Thanks for the suggestion and sorry to say that it didn't work.
Hi atrol, Thanks for the reply. Being a tester, I am not good with coding. Is it possible to give me a code to duplicate the summary into description field please ?
Thanks,
Mamatha
Hi atrol, Thanks for the reply. Being a tester, I am not good with coding. Is it possible to give me a code to duplicate the summary into description field please ?
Thanks,
Mamatha
Re: How to make a field not mandatory
Hi Mamatha,
apart from the very true comment from Atrol, my solution does work (just tried and proved). Suggest you try again
apart from the very true comment from Atrol, my solution does work (just tried and proved). Suggest you try again

Re: How to make a field not mandatory
Hi Cas,
Thanks a lot. That worked. Sorry, previously i didn't do it properly.
Once again thanks,
Mamatha
Thanks a lot. That worked. Sorry, previously i didn't do it properly.
Once again thanks,
Mamatha