Problem using custom fields: list too long

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
rudy
Posts: 10
Joined: 12 Apr 2006, 14:36
Location: Paris

Problem using custom fields: list too long

Post by rudy »

Hi,

I need to create a field that would be a multiselection list composed of 422 elements. The custom field definition is not adapted to such an important list since it's limited to 255 caracters.

What is the best way to create this field? would it be a probleme if i change the database definition in order to place all the values in my custom field?

I'm using mantis 1.0.0rc4.

Thx,

Rudy.
phpchris
Posts: 9
Joined: 15 Sep 2006, 08:53

Post by phpchris »

*bump* same question here..
Narcissus
Developer
Posts: 338
Joined: 17 Feb 2005, 09:45

Post by Narcissus »

If I were you, I'd look at dynamic custom fields. Although your values don't change, it will let you define a function that can return all of your values. That way you don't need to change the database structure at all.

See http://www.futureware.biz/blog/index.ph ... &tb=1&pb=1 for more details.
starkeus
Posts: 15
Joined: 08 Sep 2006, 12:30
Location: France

Post by starkeus »

For me, i often update my customs fiels enumerations and i can't update everty time the php file, so i decided to change the type of the column VARCHAR(255) to TEXT and i updated the file manage_custom_field_edit_page.php and i deleted the maxlength property.
Narcissus
Developer
Posts: 338
Joined: 17 Feb 2005, 09:45

Post by Narcissus »

No offence, but the way I see it, you have to update *something* each time you want to change / add values.

How much harder is it to change a PHP file than logging in and changing the value in the Mantis interface? At least by using the PHP file you might be able to find a more 'automatic' way of updating that list then not have to update it yourself at all!

It's your call, naturally, but anyway...
starkeus
Posts: 15
Joined: 08 Sep 2006, 12:30
Location: France

Post by starkeus »

No pb ;)
But not all the user (like manager) are allowed to connect to the server and update the php file. So it's better to modify the custom fiels from Mantis administration for their own project. :D
Narcissus wrote:No offence, but the way I see it, you have to update *something* each time you want to change / add values.

How much harder is it to change a PHP file than logging in and changing the value in the Mantis interface? At least by using the PHP file you might be able to find a more 'automatic' way of updating that list then not have to update it yourself at all!

It's your call, naturally, but anyway...
danich
Posts: 18
Joined: 21 May 2007, 17:39

Post by danich »

this is how I solved it:

Code: Select all

	function custom_function_default_enum_biglist() {
		return 'ROLDAN|OT|VOTO|DATOS|TELEFE|MOVIL|AW|PAX|AMOR|SU|SON|SMS|PLANETA|LICI|CASADOS|BDA|TV|PASION|ROS|MDQ|FUT|TUC|SAL|JEFE|VOT|LUCHA|TRATO|XD|ARG|TELE|ALMA|CHIQUI|ELEGIDOS|LILI|MONTE CRISTO|PRE|SIETE|MAIPU|INFO|MESSI|DIARIO|MUSICA|ASTRO|PIROPO|JAJA|CHAT|FM|DETECTIVES|FRUTA|GH|GANA|MAGIA|ANGELES|BLUE|CAPO';
	}
Narcissus wrote:No offence, but the way I see it, you have to update *something* each time you want to change / add values.

How much harder is it to change a PHP file than logging in and changing the value in the Mantis interface? At least by using the PHP file you might be able to find a more 'automatic' way of updating that list then not have to update it yourself at all!

It's your call, naturally, but anyway...

yes, it's not practical at all
Post Reply