Removing Required Fields

Get help from other users here.

Moderators: Developer, Contributor

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

Removing Required Fields

Post by wedge »

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: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Removing Required Fields

Post by atrol »

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: 08 Jan 2013, 15:49

Re: Removing Required Fields

Post by wedge »

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: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Removing Required Fields

Post by atrol »

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: 08 Jan 2013, 15:49

Re: Removing Required Fields

Post by wedge »

lol, seriously? that's it?

Curious though, why I can't remove the 'description' box. ?
wedge
Posts: 19
Joined: 08 Jan 2013, 15:49

Re: Removing Required Fields

Post by wedge »

$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: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: Removing Required Fields

Post by cas »

$g_enable_profiles = OFF; :mrgreen:
wedge
Posts: 19
Joined: 08 Jan 2013, 15:49

Re: Removing Required Fields

Post by wedge »

Rgr that, Will give it a try when I get to work. Thanks Cas.
wedge
Posts: 19
Joined: 08 Jan 2013, 15:49

Re: Removing Required Fields

Post by wedge »

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: 08 Jan 2013, 15:49

Re: Removing Required Fields

Post by wedge »

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: 08 Jan 2013, 15:49

Re: Removing Required Fields

Post by wedge »

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: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Removing Required Fields

Post by atrol »

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: 08 Jan 2013, 15:49

Re: Removing Required Fields

Post by wedge »

Because i'm noob..heh.

I'll remove them, thanks.
Post Reply