Hide mandatory fields

Post about your customizations to share with others.

Moderators: Developer, Contributor

Post Reply
MaxMax
Posts: 5
Joined: 12 Oct 2020, 20:42

Hide mandatory fields

Post by MaxMax »

I want to remove all fields on the "new issue" form that shouldn't be assigned by the reporter, keep it to a minimal.
For example the field "category" is mandatory and needs a value. Can I somehow hide the field with a default value?
Removing the field from $g_bug_report_page_fields gives a database error when submitting the issue.

Code: Select all

$g_bug_report_page_fields = array(
	'additional_info',
	'attachments',
	'priority',
	'reproducibility',
	'severity',
	'steps_to_reproduce',
);
APPLICATION ERROR #11
A necessary field "category" was empty. Please recheck your inputs.
Please use the "Back" button in your web browser to return to the previous page. There you can correct whatever problems were identified in this error or select another action. You can also click an option from the menu bar to go directly to a new section.
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Hide mandatory fields

Post by atrol »

You can add the following line to file config_inc.php

Code: Select all

$g_allow_no_category = ON;
Please use Search before posting and read the Manual
MaxMax
Posts: 5
Joined: 12 Oct 2020, 20:42

Re: Hide mandatory fields

Post by MaxMax »

Tank you it did the trick... almost.
The category is blank. Can I have a default value assigned to it instead?
cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: Hide mandatory fields

Post by cas »

you could change the field in the DB to have a default value but that is not such a great idea.
Better is to have a look at the plugin called EasyEnter, have a look here:
https://github.com/mantisbt-plugins/EasyEnter

That offers what you want in my view :mrgreen:
Post Reply