Removing blank space in custom field

1.8 related questions and discussions.
Please upgrade to LATEST 1.9.x.
No more fixes for 1.8.

Moderators: Amaradana, TurboPT, TL Developers

Locked
Anakin
TestLink user
Posts: 9
Joined: Wed Aug 11, 2010 3:12 am

Removing blank space in custom field

Post by Anakin »

Hi,
I realize that when creating numeric or text type custom fields, the input fields would always be filled with blank spaces even before i type anything in them. and i need to remove these blank spaces before i can type anything in it. i usually set my custom fields to be seen when creating test cases. Is there any way to remove the blank spaces by defualt? Any help would be greatly appreciated.

Regards.
TurboPT
Member of TestLink Community
Posts: 343
Joined: Sun Dec 10, 2006 4:51 am

Re: Removing blank space in custom field

Post by TurboPT »

I have not tried numeric, but I added a custom field as type 'string' [cursor at left-hand start of textbox] and 'text area' [cursor in upper-left corner], but neither field contained any spaces when first displayed...

So it's not clear what might be happening. [might there be some other language in use?]
Would you mind posting the exact steps you did to create the field[s] so that we can try the same?
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

Re: Removing blank space in custom field

Post by fman »

think is an old issue. User need to dig on cfield_mgr.class.php and remove an additional space we have placed (by mistake)
on 1.9 this has been solved
Anakin
TestLink user
Posts: 9
Joined: Wed Aug 11, 2010 3:12 am

Re: Removing blank space in custom field

Post by Anakin »

fman wrote:think is an old issue. User need to dig on cfield_mgr.class.php and remove an additional space we have placed (by mistake)
on 1.9 this has been solved
Hi fman,
Thanks for the reply.
I've tried looking through the file and understands that it handles how custom fields are created but i'm not sure where to look at. Sorry if i sound like i need spoon feeding, i just started picking up php less than a month.
TurboPT wrote:I have not tried numeric, but I added a custom field as type 'string' [cursor at left-hand start of textbox] and 'text area' [cursor in upper-left corner], but neither field contained any spaces when first displayed...

So it's not clear what might be happening. [might there be some other language in use?]
Would you mind posting the exact steps you did to create the field[s] so that we can try the same?
Hi TurboPT,

Thanks for the reply, we are using English.
For the steps, I do this to create custom fields. "Define custom fields" -> "Create" -> "Add"
With, Type - String or numeric
Enable on - Test Spec Design
Display on Test Execution - Yes
Available for - Test Case
TurboPT
Member of TestLink Community
Posts: 343
Joined: Sun Dec 10, 2006 4:51 am

Re: Removing blank space in custom field

Post by TurboPT »

Based on what fman has mentioned, what TL version do you have? [1.8.x -- What is at the 'x' part?]
Anakin
TestLink user
Posts: 9
Joined: Wed Aug 11, 2010 3:12 am

Re: Removing blank space in custom field

Post by Anakin »

Hi TurboPT,
i'm using TestLink 1.8.5.
TurboPT
Member of TestLink Community
Posts: 343
Joined: Sun Dec 10, 2006 4:51 am

Re: Removing blank space in custom field

Post by TurboPT »

Anakin wrote: ...i'm using TestLink 1.8.5.
I have that version too.

There is nothing obvious to me in the file that fman mentioned, but there is another place to check:

In the database, table named 'custom_fields', looking only at the fields that are giving this problem, make sure the 'default_value' column is actually blank [meaning that there are no spaces in the field].

This will probably need a SQL statement to check/show the default_value's field length, as it won't be very obvious in a normal display.

I can help with the SQL if needed.
Anakin
TestLink user
Posts: 9
Joined: Wed Aug 11, 2010 3:12 am

Re: Removing blank space in custom field

Post by Anakin »

TurboPT wrote:
Anakin wrote: ...i'm using TestLink 1.8.5.
I have that version too.

There is nothing obvious to me in the file that fman mentioned, but there is another place to check:

In the database, table named 'custom_fields', looking only at the fields that are giving this problem, make sure the 'default_value' column is actually blank [meaning that there are no spaces in the field].

This will probably need a SQL statement to check/show the default_value's field length, as it won't be very obvious in a normal display.

I can help with the SQL if needed.
Hi, sorry for the delayed response. I managed to find the table and found out that "default_value" and "possible_value" is a long string of spaces.
Now i need help with the SQL statement to change the value in the "default_value" to empty. Should it be set to "0" or "null"? And how should the SQL statement be?
Thanks again for your help.
Anakin
TestLink user
Posts: 9
Joined: Wed Aug 11, 2010 3:12 am

Re: Removing blank space in custom field

Post by Anakin »

Hi, i have successfully removed the empty spaces from the fields. I defined the "default_value" to allow NULL, then i updated the value inside the "default_value" for the custom fields i created as NULL. It's working perfectly now. Thanks all for help!
Locked