Page 1 of 1

Problem using custom fields: list too long

Posted: 31 Aug 2006, 16:04
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.

Posted: 15 Sep 2006, 08:58
by phpchris
*bump* same question here..

Posted: 15 Sep 2006, 13:01
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.

Posted: 17 Sep 2006, 09:22
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.

Posted: 17 Sep 2006, 12:42
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...

Posted: 18 Sep 2006, 14:54
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...

Posted: 26 Jun 2007, 20:19
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