problem faced in custom fields

Ask community to help.

Moderators: Amaradana, TurboPT, TL Developers

Post Reply
krisna
TestLink user
Posts: 1
Joined: Sat Dec 20, 2008 3:36 pm

problem faced in custom fields

Post by krisna »

Hi Teamst,
I have problem with new custom field management,
We have test cases which has test data & Precondition fields where it is above 2000 characters,
Please help me out from this issue.
At present the custom fields are displaying only 250 characters remaining are lost.

Please reply with the steps to resolve this issue.
TurboPT
Member of TestLink Community
Posts: 343
Joined: Sun Dec 10, 2006 4:51 am

Post by TurboPT »

Q: for TL developers.

I can assist with this question, but should I go through the steps?
What would be the impact [i.e. upgrades] if changes are applied -- as this will be a customized (outside of TL) change? (so that the original poster will be aware)

Also, I will investigate the import handling [the php-side] as well. (to make sure it all goes smoothly at both ends)
havlatm
Member of TestLink Community
Posts: 940
Joined: Mon Oct 31, 2005 1:24 am
Location: Czech

Post by havlatm »

This is because database type is string with 256 characters. So, application miss maximal size checking. I didn't develop this feature, so I don't know details. My expectation is that 'text' DB type must be implemented to solve it.

I suggest to add precondition to steps or summary meantime. I expect that in some future version will be added possibility to cutomize structure of TC. There are people looking for step-by-step structure, etc.
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

Post by fman »

I need to understand impacts at DB level if we choose to use text column type.
Anyway my vote is leave custom fields as are implemented today (I've have used mantis and dotptoject as model), with a limited (a very limited size) to avoid abuse.

You can do changes in your installation without ANY problem
pvmeerbe
TestLink user
Posts: 6
Joined: Tue Dec 18, 2007 12:40 pm

Adjusting custom field size limitation

Post by pvmeerbe »

Hi ,

In the current code base (1.8.1) there seems to be 2 locations where the size of the custom text field is determined:
- the database model : Table cfield_design_values, field 'values' which is set to variable char with limit 500
- the file lib/functions/cfield_mgr.class.php in which a variable $max_length_value is set to 255

In other words the database accepts entries until 500 chars, but when using the interface only 255 are saved.

I've modified my own installation to use a database type var char of max 2000 char + also updated the variable
(ALTER TABLE cfield_design_values ALTER COLUMN value TYPE varchar(2000))

Is there any objection to modify the code base to a higher max value as described above? 255 chars is low for a 'text' type custom field ...
pvmeerbe
TestLink user
Posts: 6
Joined: Tue Dec 18, 2007 12:40 pm

Re: Adjusting custom field size limitation

Post by pvmeerbe »

Sorry,
Small mistake : the default value for the $max_length_value was already modified on my installation from 255 to 500.

kind regards
Pieter
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

Post by fman »

make changes in your code , and reapply it after every TL major update.
ALL CF data still integer values are stored in this field, that's why I think is not a good idea transform in in text type.
pvmeerbe
TestLink user
Posts: 6
Joined: Tue Dec 18, 2007 12:40 pm

Re: problem faced in custom fields

Post by pvmeerbe »

FYI in TestLink version 1.9.1 I found the following configurable value :

config.inc.php: * 20090823 - franciscom - new option custom_field_max_length
config.inc.php:$tlCfg->custom_fields->max_length = 255;

allowing to set the max length as described in this post. Mind that the database currently (1.9.1 new database ) limits the size to 4000 :

Table "public.cfield_design_values"
Column | Type | Modifiers
----------+-------------------------+----------------------------------------
field_id | integer | not null default 0
node_id | integer | not null default 0
value | character varying(4000) | not null default ''::character varying
Post Reply