Page 1 of 1
How to make a field not mandatory
Posted: 27 Apr 2011, 14:38
by mamathak
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
Re: How to make a field not mandatory
Posted: 27 Apr 2011, 15:04
by atrol
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)
Re: How to make a field not mandatory
Posted: 27 Apr 2011, 15:09
by cas
in core\bug_api.php you will find (line 272):
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 );
}
}
change it into:
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 );
}
}
That may do the trick

Re: How to make a field not mandatory
Posted: 28 Apr 2011, 09:42
by mamathak
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
Re: How to make a field not mandatory
Posted: 28 Apr 2011, 10:34
by cas
Hi Mamatha,
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
Posted: 28 Apr 2011, 12:13
by mamathak
Hi Cas,
Thanks a lot. That worked. Sorry, previously i didn't do it properly.
Once again thanks,
Mamatha