Removing Required Fields

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
wedge
Posts: 19
Joined: Jan 08, 2013 10:49 am

Removing Required Fields

Post by wedge » Jan 29, 2013 4:29 pm

Hi,

I would like to edit some of the static required fields

Example: Description, I've removed it in : *bug_revision_view.php, bug_report_page.php, bug_view_inc.php, bug_report_page.php, bug_report.php

When I try to submit a form, I get a " required field 'Description' is missing" error.

I see it in the Columns section but I'm not sure how to remove it from there, which file.

Is there somewhere else I should be looking to make this change too??

Thank You,

atrol
Site Admin
Posts: 7659
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: Removing Required Fields

Post by atrol » Jan 29, 2013 4:40 pm

I recommend to use the powerful customization options of MantisBT instead of changing the source code.
Start reading our manual, especially this chapter http://www.mantisbt.org/docs/master-1.2 ... FIG.FIELDS
Please use Search before posting and read the Manual

wedge
Posts: 19
Joined: Jan 08, 2013 10:49 am

Re: Removing Required Fields

Post by wedge » Feb 05, 2013 1:55 pm

I've been looking over what you posted, but I must be missing something terribly easy here.

The examples tell you to look in the constant_inc.php to make changes to overall appearance of the bug form? But everything I comment out, still appears?

atrol
Site Admin
Posts: 7659
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: Removing Required Fields

Post by atrol » Feb 06, 2013 12:36 am

Add the following lines to file config_inc.php and adjust to your needs

Code: Select all

   /**
    * An array of the fields to show on the bug report page.
    *
    * The following fields can not be included:
    * id, project, date_submitted, last_updated, status,
    * resolution, tags, fixed_in_version, projection, eta,
    * reporter.
    *
    * The following fields must be included:
    * category_id, summary, description.
    *
    * To overload this setting per project, then the settings must be included in the database through
    * the generic configuration form.
    *
    * @global array $g_bug_report_page_fields
    */
   $g_bug_report_page_fields = array(
      'category_id',
      'view_state',
      'handler',
      'priority',
      'severity',
      'reproducibility',
      'platform',
      'os',
      'os_version',
      'product_version',
      'product_build',
      'target_version',
      'summary',
      'description',
      'additional_info',
      'steps_to_reproduce',
      'attachments',
      'due_date',
   );
Please use Search before posting and read the Manual

wedge
Posts: 19
Joined: Jan 08, 2013 10:49 am

Re: Removing Required Fields

Post by wedge » Feb 06, 2013 9:14 am

lol, seriously? that's it?

Curious though, why I can't remove the 'description' box. ?

wedge
Posts: 19
Joined: Jan 08, 2013 10:49 am

Re: Removing Required Fields

Post by wedge » Feb 06, 2013 10:02 am

$g_bug_report_page_fields = array(
'category_id' =>'1',
'view_state' =>'2',
'handler' =>'3',
'priority' =>'4',
'severity' =>'5',
'reproducibility' =>'6',
'platform' =>'7',
'os' =>'0',
'os_version' =>'0',
'product_version' =>'0',
'product_build' =>'0',
'target_version' =>'0',
'summary' =>'8',
'description' =>'9',
'additional_info' =>'10',
'steps_to_reproduce' =>'11',
'attachments' =>'12',
'due_date' =>'13',
);

Removed these options, but they are still available ..

'os',
'os_version',
'product_version',
target_version' =>'0',

cas
Posts: 602
Joined: Mar 11, 2006 11:08 am
Contact:

Re: Removing Required Fields

Post by cas » Feb 07, 2013 6:17 am

$g_enable_profiles = OFF; :mrgreen:

wedge
Posts: 19
Joined: Jan 08, 2013 10:49 am

Re: Removing Required Fields

Post by wedge » Feb 07, 2013 7:47 am

Rgr that, Will give it a try when I get to work. Thanks Cas.

wedge
Posts: 19
Joined: Jan 08, 2013 10:49 am

Re: Removing Required Fields

Post by wedge » Feb 07, 2013 9:31 am

I still see those variables on the form.

Anything else ? heh.

This is what I created at the end of my config_inc.php file.

/* Tunables
$g_enable_profiles = OFF;

$g_bug_report_page_fields = array(
'category_id' =>'1',
'view_state' =>'2',
'handler' =>'3',
'priority' =>'4',
'severity' =>'5',
'reproducibility' =>'6',
'platform' =>'7',
'os' =>'0',
'os_version' =>'0',
'product_version' =>'0',
'product_build' =>'0',
'target_version' =>'0',
'summary' =>'8',
'description' =>'9',
'additional_info' =>'10',
'steps_to_reproduce' =>'11',
'attachments' =>'12',
'due_date' =>'13',
);

wedge
Posts: 19
Joined: Jan 08, 2013 10:49 am

Re: Removing Required Fields

Post by wedge » Feb 07, 2013 10:15 am

When making a Description line with /* I was not closing it off, */ which was preventing the variables from running :D

Lesson learned...

Until my next issue :D

Cheers.

wedge
Posts: 19
Joined: Jan 08, 2013 10:49 am

Re: Removing Required Fields

Post by wedge » Feb 07, 2013 12:07 pm

Well here is my next issue

When switching off Global profiles, and using the tweak method, enough though category_id is enabled in the configuration, it does not display on the bug form.

It is needed to create a bug but it's not present. Is there a variable for that ?

atrol
Site Admin
Posts: 7659
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: Removing Required Fields

Post by atrol » Feb 07, 2013 4:10 pm

You have to remove (or comment) the lines that you don't want.
I am wondering why you added the numbers.
Please use Search before posting and read the Manual

wedge
Posts: 19
Joined: Jan 08, 2013 10:49 am

Re: Removing Required Fields

Post by wedge » Feb 07, 2013 6:48 pm

Because i'm noob..heh.

I'll remove them, thanks.

Post Reply