Increase custom field size length

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
ntushar
Posts: 22
Joined: 07 Apr 2022, 06:49

Increase custom field size length

Post by ntushar »

Hi,

We use Mantis 2.25.5. We have created custom field with below settings.
type - string
Possible value -- Blank
Default value -- Blank
Regular expression -- Blank
Min. Length -- 0
Max. Length -- 0

We found out that this custom field only accepts 255 characters. How can we increase this custom field size limit so that it can accept 512 characters.
atrol
Site Admin
Posts: 8558
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Increase custom field size length

Post by atrol »

Using type "Text Area" instead of "String" might also be an option.
Please use Search before posting and read the Manual
ntushar
Posts: 22
Joined: 07 Apr 2022, 06:49

Re: Increase custom field size length

Post by ntushar »

This custom field is used to add multiple email addresses so that notification email can be sent to these specified email addresses.
If we change this custom field from "string" to "Text Area" than notification emails are not sent to specified email addresses.

Is there any other solution other than changing custom field to "Text Area".
atrol
Site Admin
Posts: 8558
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Increase custom field size length

Post by atrol »

The clean way would be to write a plugin that implements an own logic and storage for that.
The dirty way would be to change the database schema, so that column value of mantis_custom_field_string_table could store more than 255 characters.
Please use Search before posting and read the Manual
ntushar
Posts: 22
Joined: 07 Apr 2022, 06:49

Re: Increase custom field size length

Post by ntushar »

Tried the dirty way but still not working. When trying to report issue, custom field is not accepting more than 255 characters. Changes done are as below. Not sure if i am updating correct table and column.

In mantis_custom_field_table changed default_value length from 255 to 512.
atrol
Site Admin
Posts: 8558
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Increase custom field size length

Post by atrol »

Changing default_value length in mantis_custom_field_table can't work.

As I told before, as a first step you have to change the definition of column value of mantis_custom_field_string_table in database.
After that, more changes in database schema would be needed if you want also use a long default value. (I guess this is not needed)

All you have to do after applying the database schema changes should be to set Max. Length in the defintion of the custom field.
Without that, your browser will prevent you from entering more than 255 characters into the field.
Please use Search before posting and read the Manual
Post Reply