Hi there. We have just started playing with your testcase tracker. Very good impression so far.
We are using MS SQL Server 2005 as database server and version 1.7.4 of TestLink. The admin has created a customfield named Precondition for testcases -> looks fine on the testcase editor.
I have created a testcase and added a text in the Precondition field. When I look at the test case after saving all but the first two characters of the Precondition have disappeared. We checked in the databse - also only two characters. As far as I can see this applies to inserts and updates.
Any idea? Are we doing anything wrong?
Thanks a lot for your help and greetings from Zurich.
Ralf
Customfield as textarea - only first 2 chars arrive in dbase
Moderators: Amaradana, TurboPT, TL Developers
I have located cfield_mgr.class and the method design_values_to_db() as the relevant place to check the sql statement. So I put in
echo($sql);
right before the query is executed.
I was hoping to see the sql statement in my browser - but no such luck. Not being a PHP expert by any account I'm not sure where I went wrong. Are the classes compiled and cached by any chance so that the server ignores my changes?
Thanks for your help.
echo($sql);
right before the query is executed.
I was hoping to see the sql statement in my browser - but no such luck. Not being a PHP expert by any account I'm not sure where I went wrong. Are the classes compiled and cached by any chance so that the server ignores my changes?
Thanks for your help.
Sorry, my mistake. I think I saved the wrong file. echo($sql); is working now.
Result is:
UPDATE cfield_design_values SET value=' 123' WHERE field_id=1 AND node_id=3
UPDATE cfield_design_values SET value='12345678901234567890' WHERE field_id=2 AND node_id=3
The second statement is for a customfield defined as string - all working as expected.
The first statement is for a customfield defined as textarea. My input again was 12345678901234567890. But only 123 is sent to the database.
Any ideas?
Result is:
UPDATE cfield_design_values SET value=' 123' WHERE field_id=1 AND node_id=3
UPDATE cfield_design_values SET value='12345678901234567890' WHERE field_id=2 AND node_id=3
The second statement is for a customfield defined as string - all working as expected.
The first statement is for a customfield defined as textarea. My input again was 12345678901234567890. But only 123 is sent to the database.
Any ideas?
I added a few more echo statements to zoom into the problem.
Surprisingly the length of the string turns out to be 272 where I was only expecting 20. $this->max_length_value is 255 as set at the top of the file. So the substr in the if statement is executed.
When I check $value after the substr has been executed all but the first three characters have been cut off.
Not sure whether there are issues in PHP with the substr function. Maybe $value is not a string and there is an implicit cast happening on the way?
Very much looking forward to your opinion.
Ralf
Surprisingly the length of the string turns out to be 272 where I was only expecting 20. $this->max_length_value is 255 as set at the top of the file. So the substr in the if statement is executed.
When I check $value after the substr has been executed all but the first three characters have been cut off.
Not sure whether there are issues in PHP with the substr function. Maybe $value is not a string and there is an implicit cast happening on the way?
Very much looking forward to your opinion.
Ralf