View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0005258 | mantisbt | custom fields | public | 2005-02-18 08:21 | 2008-10-18 18:34 |
Reporter | hinke | Assigned To | grangeway | ||
Priority | normal | Severity | feature | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 0.19.2 | ||||
Summary | 0005258: Be able to enter more than 255 characters when adding a new custom field | ||||
Description | Would be nice to be able to add custom fields with more than 255 characters. For example adding a list TEST|TEST2|TEST3....and so on with more than 255 characters. Right now it seems like it is limited in the database (It is stored as VARCHAR and maybe VARCHAR is only limited to 255 chars in MySQL?) and in the actual textfield for the custom field. | ||||
Tags | No tags attached. | ||||
Any news on this issue? Thanks |
|
You can probably achieve what you need using a custom function. I had a similar requirement and solved it by (a) creating a new table in the database containing the possible values for the enumeration (and some other information I needed), and (b) writing a custom function to create the enumeration using implode(). |
|
The only thing you need, is to expand the database field "possible_values" to the length you need (varchar 800), additionally you must change the form field "possible_values" to fit this length. It would be nice when it was implemented in the next release. |
|
The suggestions for solutions make sense. However, I think that the user should not have to take those suggestions to have a larger max length. I suggest that the maxlength for the possible_values field in the mantis_custom_field_table be changed from varchar(255) to something a little less constrictive. My use case is regressive version tracking. I want every version ever specified for all of our projects in the drop down for Regressive Version. However, having the interface and the database restrict the options to 255 make it impossible to have a version list of Changing it ourselves will be a great solution in the meantime, but it does not bode well for easy updates and maintenance in the future. |
|
MySQL up to 5.03 does not support VARCHARs to be longer than 255 Characters. You will have to switch to "TEXT" after that. I don't know if other DB's have similar restrictions. |
|
I have Mantis installed on Sql server and I have changed the size for varchar(800) and in the .php I changed to maxlength="800". Then when I save a custom field it save in database correctly, but show in manage_custom_field_page.php and other place only 255 chars. Is there another place I need to change to have a Enum field bigger than 255 characters? |
|
I second/third the previous votes changing this in the codebase. I changed the type to TEXT and edited the form field, but now I have to worry about remembering that every time I move/upgrade things :-( As I mentioned in the forum, some fields are clearly meant to hold much more data than others, and shouldn't be held to the same (and much tighter) restrictions of other, simpler fields. |
|
Fixed in SVN 23:22 < CIA-39> mantisbt: prichards * r4753 /trunk/mantisbt/ (admin/schema.php |
|
Msg for Grangeway Any ideas when this change will be reflected in released version - i have an issue where i need the possible_values column to handle up to 400+ characters. Many thanks |
|
I think is is broken again. I have version 1.1.1 installed and even after increasing the size of the text box and the column in the database only the lines up to 255 chars are displayed in custon fields of type enumeration or multiselction list drop down boxes. |
|
You only need to change the length of the value field in the table to text or a bigger varchar value. |
|
To Buga, That was the first thing I did. We use SQL Server so I changed the size of the database field to 1000 (which is well within SQL Server limits for a varchar). I also had to change the size of the text box for Possible Values in the manage_custom_field_edit_page.php file because it was hardcoded to maxlenght=255. I tested my changes and was able to enter and save possible values greater than 255 characters long. I verified that it was stored correctly in the database. The problem occurs when Mantis reads that field in from the database. It is getting truncated to 255 characters no matter what is stored in the database. Since this seams to work using MySQL (just by reading what that it was fixed in this bug) I'm beginning to think it's an issue in the driver for SQL Server. |
|
I dont have a SQL Server to test this but if you have this problem while reading from sql server it might really a sql server specific "bug". I am using Mantis 1.1.1 and there the maxlength isnt hardcoded. So a simple DB change was enough to fix this problem. |
|