View Issue Details

IDProjectCategoryView StatusLast Update
0004705mantisbtcustom fieldspublic2008-07-24 16:50
Reporterjohnwebbcole Assigned Tovboctor  
PrioritynormalSeverityfeatureReproducibilityalways
Status closedResolutionduplicate 
Summary0004705: Add Text type in addition to String for custom field types
Description

It would be nice to have an additional type or flag so that a custom field could display a textarea instead of a single line textbox.

One small issue is that custom fields are limited to 255 char, so this may not make too much sense, because the standard textarea in mantis is 7x80 (560).

The problem I'm trying to solve is to create an enhanced changelog with a field used as a README description to go with the bug number and summary. We have been using a bugnote with README in the text to tag the note as the README description, but I am trying to simplify this process. The custom fields are almost perfect for this task.

TagsNo tags attached.

Relationships

duplicate of 0006626 closeddaryn Support "Memo" custom field type 
related to 0005000 closedvboctor String custom field type isnt big enough - need multiline string option 
child of 0005650 acknowledged Investigate/Implement Enchanced Custom Field support 

Activities

jsimon

jsimon

2004-11-09 15:44

reporter   ~0008310

It would be really cool to have this feature as mentioned...the ability to have a custom field be a textbox/textarea just like the required fields "Additional Information", "Description" and the "Bug Notes". I was looking at the code and the database setup, because I was thinking about changing it for myself to use, but the only way I could see was to either change the table where custom field data was stored to to have this text be a text value instead of varchar(255), which limited it to a single line of 256 characters. I hesitate to do this, because I figure that will possibly hinder me upgrading easily later on..

So yeah, I'm wondering as well if there is any planning for this to be added/enabled in any future versions (hopefully soon :))?? It would be immensely useful.

It would be extremely helpful for things like I was hoping to implement textarea custom fields for: Testing Commments (testing steps for fixes), Technical Investigation notes, pasting in emails or technical discussions, pasting in snippets of source code (oddly, it really would be useful).

jbiechele

jbiechele

2005-02-09 12:44

reporter   ~0009272

This is just to confirm that I have exactly the same need and would be very happy to be able to define custom fields as textarea.

pdoconnor

pdoconnor

2005-03-14 06:03

reporter   ~0009528

I would also like this feature to be added. We have to answer a number of questions (e.g. installation steps, backout plan etc.) for a "Product Change Order", and being able to retrieve these answers directly from Mantis would be a godsend !!!!

illes

illes

2005-04-11 08:40

reporter   ~0009784

I would also like this feature.
Currently you can use a textarea with 255 characters, just follow these steps:

  1. core/custom_field_api.php
    function print_custom_field_input
    case CUSTOM_FIELD_TYPE_TEXTAREA:
    echo '<textarea name="customfield' . $t_id . '" cols="60" rows="5" wrap="virtual"';
    if(0 < $p_field_def['length_max'] ) {
    echo ' maxlength="' . $p_field_def['length_max'] . '"';
    } else {
    echo ' maxlength="255"';
    }
    echo " value=\"$t_custom_field_value\">". nl2br($t_custom_field_value). "</textarea>";
    break;

  2. config_inc.php
    $g_custom_field_type_enum_string = '0:string,1:numeric,2:float,3:enum,4:email,5:checkbox,6:list,7:multiselection list,8:date,9:textarea';
  3. custom_strings_inc.php
    $s_custom_field_type_enum_string = '0:String,1:Numeric,2:Float,3:Enumeration,4:Email,5:Checkbox,6:List,7:Multiselection list,8:Date,9:Textarea';
  4. custom_constant_inc.php

    custom Field types

    define( 'CUSTOM_FIELD_TYPE_TEXTAREA', 9 );

emathieu

emathieu

2005-05-05 17:08

reporter   ~0010040

I am also very interested in this feature.
I implemented illes patch and it works great, thanks.
I just replaced nl2br($t_custom_field_value) with $t_custom_field_value
because extra line break were added each time I updated an issue.

grangeway

grangeway

2005-05-25 17:57

reporter   ~0010234

This functionality won't change in 1.0, however, as part of changes I might look at adding for 1.1, i'll see if we can change the database field from varchar(255) to something larger.

illes

illes

2005-05-26 02:02

reporter   ~0010240

Great, I'm looking forward to it!

eurayle

eurayle

2005-06-08 09:01

reporter   ~0010411

I needed the textarea custom field too, so my workaround included hacking the custom_field_api.php file, and also changing the database schema to include a new table. The new table has the same structure as the mantis_custom_field_string_table, except for the value field which has TEXT data type.

Some more additional hacking in custom_field_api.php (in addition to those mentioned by illes), to select the correct custom field table to use by detecting the custom field type:
custom_field_get_value function
custom_field_set_value function
string_custom_field_value function (since it calls the custom_field_get_value function)

polzin

polzin

2005-08-25 10:23

reporter   ~0011292

A simpler solution (one could say "hack") is with a patch in 0005679

emathieu

emathieu

2006-11-15 14:27

reporter   ~0013724

eurayle, can you provide your patch ?

nyhgo

nyhgo

2007-01-26 11:58

reporter   ~0013968

Since we needed long text custom fields (textareas) we tried the same king of solution that illes wrote on 05-04-11 08:40.
We use Mantis on a mySQL 4.1.9 database. To allow long texts, we modified the database schema for 3 fields (standard SQL command that does not erase existing data) :
ALTER TABLE mantis_custom_field_table MODIFY possible_values TEXT NOT NULL;
ALTER TABLE mantis_custom_field_table MODIFY default_value TEXT NOT NULL;
ALTER TABLE mantis_custom_field_string_table MODIFY value TEXT NOT NULL;

All works fine since 4 days now on our test server, maybe you have any ideas of problems those modifications could lead to...

mfo62786

mfo62786

2007-02-19 11:59

reporter   ~0014063

I tried to do the same as nyhgo, going into the database and changing the type of the field, but I am still be capped at 511 characters. There seems to be something else limiting the the size of fields, since a text should hold 65,535 characters.

fischerhh

fischerhh

2008-05-28 04:04

reporter   ~0017928

We are "upgrading" from a MS Access DB containing some 900 bug reports to Mantis 1.2.0, which, I am sure, will facilitate our work a lot. The Access DB contains several text fields with more than 500 characters, thus a feature like CUSTOM_FIELD_TYPE_TEXTAREA is required (also for new bug reports). A limit of 511 characters would be acceptable, although truncation of the original texts would occur in some cases. However, the extensions used by illes and others seem not to be applicable in Mantis 1.2.0. Before trying a hack (with, as a beginner, limited knowledge of Mantis), which will complicate future Mantis upgrades: are there plans to implement custom text fields or textareas with more than 255 (preferentially some 1023) characters in the near future?

Issue History

Date Modified Username Field Change
2004-10-13 14:59 johnwebbcole New Issue
2004-11-09 15:44 jsimon Note Added: 0008310
2005-02-09 12:44 jbiechele Note Added: 0009272
2005-03-14 06:03 pdoconnor Note Added: 0009528
2005-04-11 08:40 illes Note Added: 0009784
2005-05-05 17:08 emathieu Note Added: 0010040
2005-05-25 17:56 grangeway Relationship added child of 0005650
2005-05-25 17:57 grangeway Note Added: 0010234
2005-05-26 02:02 illes Note Added: 0010240
2005-06-08 09:01 eurayle Note Added: 0010411
2005-08-25 10:23 polzin Note Added: 0011292
2006-09-11 03:25 vboctor Relationship added related to 0005000
2006-11-15 14:27 emathieu Note Added: 0013724
2007-01-26 11:58 nyhgo Note Added: 0013968
2008-05-28 04:04 fischerhh Note Added: 0017928
2008-07-15 04:14 vboctor Relationship added duplicate of 0006626
2008-07-15 04:14 vboctor Status @0@ => resolved
2008-07-15 04:14 vboctor Resolution @0@ => duplicate
2008-07-15 04:14 vboctor Assigned To => vboctor
2008-07-24 16:50 vboctor Status @0@ => closed