require native field
Moderators: Developer, Contributor
require native field
i just want to make the native field "fixed in version" mandatory before resolving any issues. I red the other post about it and try to apply codes but it can not work. is it not possible with native fields? or the appropriate function is not fixed in custom_functions_inc.php ?
Re: require native field
I just come to resolve the problem by adding these lines :
if(is_blank($this->fixed_in_version)){
//error_parameters(lang_get('fixed in version'));
trigger_error( ERROR_EMPTY_FIELD, ERROR);
}
in bug_api.php in the function validate( $p_update_extended = true).
now i want this only for a specific project. what can i do?
if(is_blank($this->fixed_in_version)){
//error_parameters(lang_get('fixed in version'));
trigger_error( ERROR_EMPTY_FIELD, ERROR);
}
in bug_api.php in the function validate( $p_update_extended = true).
now i want this only for a specific project. what can i do?
Re: require native field
I recommend to write a custom validation function custom_function_default_issue_create_validate instead of changing any existing source code of MantisBT.
http://www.mantisbt.org/docs/master-1.2 ... USTOMFUNCS
http://www.mantisbt.org/docs/master-1.2 ... USTOMFUNCS
Re: require native field
Just put your code between another IF statement that checks for the correct project-id, something like :
if ($this->project_id==24){
your code
}
if ($this->project_id==24){
your code
}
Re: require native field
thanks!! it's working but i do not manage to resolve the problem by ATROL's method!! i red the doc and i apply changes but i didn't understand why it's not working..even if i put the example of the doc to see the effect, i can not notice anything!! perhaps i don't know what exactely to put as parameter of the function "function custom_function_override_issue_create_validate($p_new_issue_data)" .. For the moment i'll keep the one who works(modifications done in bug-api) while looking for the way to resolve it by custom function!!..
Re: require native field
Suggest you do use Atrol's method since it will be available also after an upgrade.
I am sure if you use the script name from his last mail, it'll work ok.
I am sure if you use the script name from his last mail, it'll work ok.
Re: require native field
I'm a little amazed.. it's exactely what i'he put as the name of the function. it still doesn't work.
Re: require native field
it's working now!! it was just a bad paste of the code!! i rewrite it myself else everything was correct! thank you!! i will now adapt it to my needs.