Bug 301136 - Kexi shows no indication that text is trimmed
Summary: Kexi shows no indication that text is trimmed
Status: CLOSED FIXED
Alias: None
Product: KEXI
Classification: Applications
Component: Tables (show other bugs)
Version: 2.5 alpha1
Platform: Compiled Sources All
: NOR major
Target Milestone: 2.6
Assignee: Jarosław Staniek
URL: http://forum.kde.org/viewtopic.php?f=...
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-04 01:23 UTC by Jarosław Staniek
Modified: 2012-11-07 23:42 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 2.6.0 RC
staniek: Usability+


Attachments
Kexi file project with single table and one field limited to 200 characters. (10.00 KB, application/x-kexiproject-sqlite)
2012-06-04 01:57 UTC, Jarosław Staniek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jarosław Staniek 2012-06-04 01:23:31 UTC
Once data is saved Kexi does not trim any data secretly but there are problems in the GUI. There is no indication about text trimming that for text fields (limited by default to 200 characters) for text exceeding the maximum length.



Reproducible: Always

Steps to Reproduce:
1. Create table with one text field type (not long text)
2a. In data mode try to enter >200 characters to a field
2b. In data mode try to paste text with >200 characters
Actual Results:  
For 2a. Entering stops at 200th character, no indication there is no space anymore for entering characters.

For 2b. Pasted text is trimmed to 200 characters, although pasted successfully, no indication there was a trim.

Expected Results:  
For 2a. Entering stops at 200th character, a clearly visible tip should appear near the text box indicating there is no space anymore for entering characters.

For 2b. A clearly visible tip should appear near the text box indicating the text is larger than maximum. Two solutions should be provided: "Trim text to 200 characters" button and "Cancel" button. "More information" link should be added too, when clicked, user should see information that she can cancel the paste and redesign the table's field to allow for larger sizes (or change to long text type). Appropriate links leading to relevant options could be be added to this text too: 1. go to Design mode, 2. enlarge the max length to specified value, 3. change the subtype to long text.
Comment 1 Jarosław Staniek 2012-06-04 01:25:26 UTC
Applies to any max length set, e.g. if I change to 300, trims at 300.
Comment 2 Jarosław Staniek 2012-06-04 01:55:22 UTC
I also provided current workarounds at http://community.kde.org/Kexi/Releases/Kexi_2.4/Workaround_301136. 
Please ask if more info is needed so the document can be updated.
Comment 3 Jarosław Staniek 2012-06-04 01:57:24 UTC
Created attachment 71555 [details]
Kexi file project with single table and one field limited to 200 characters.
Comment 4 Jarosław Staniek 2012-06-09 11:54:23 UTC
Git commit da2bf9b689ead286dbed755d51802c581aea4ca4 by Jaroslaw Staniek.
Committed on 08/06/2012 at 01:35.
Pushed by staniek into branch 'master'.

Set limit to 255 for Text type in MySQL Driver

MySQL Driver:
*set limit to 255 characters for Text type (VARCHAR)
*call "SET SESSION sql_mode='TRADITIONAL'" on opening database - needed to turn warnings about trimming string values into SQL errors
*practical solution for 'Kexi shows no indication that text is trimmed' bug in case of MySQL: error is displayed eg. "Record inserting on the server failed.Message from server: Data too long for column 'hn' at row 1. SQL statement: INSERT INTO table4 (hn) VALUES ('...................'). Server result: 1406"

More info on VARCHAR support in databases: http://www.ispirer.com/wiki/sqlways/mysql/data-types/varchar_n
Related: bug 301277
REVIEW:105182
FIXED-IN:2.4.3

M  +12   -2    kexi/doc/dev/CHANGELOG-Kexi-js
M  +18   -2    kexi/kexidb/connection.cpp
M  +1    -0    kexi/kexidb/driver.cpp
M  +7    -0    kexi/kexidb/driver_p.h
M  +8    -1    kexi/kexidb/drivers/mySQL/mysqlconnection_p.cpp
M  +2    -0    kexi/kexidb/drivers/mySQL/mysqldriver.cpp

http://commits.kde.org/calligra/da2bf9b689ead286dbed755d51802c581aea4ca4
Comment 5 Jarosław Staniek 2012-06-09 12:49:54 UTC
Git commit 366d03dbbf73d7773235b4ee45be99d5b02b33bf by Jaroslaw Staniek.
Committed on 08/06/2012 at 01:35.
Pushed by staniek into branch 'calligra/2.4'.

Set limit to 255 for Text type in MySQL Driver

MySQL Driver:
*set limit to 255 characters for Text type (VARCHAR)
*call "SET SESSION sql_mode='TRADITIONAL'" on opening database - needed to turn warnings about trimming string values into SQL errors
*practical solution for 'Kexi shows no indication that text is trimmed' bug in case of MySQL: error is displayed eg. "Record inserting on the server failed.Message from server: Data too long for column 'hn' at row 1. SQL statement: INSERT INTO table4 (hn) VALUES ('...................'). Server result: 1406"

More info on VARCHAR support in databases: http://www.ispirer.com/wiki/sqlways/mysql/data-types/varchar_n
Related: bug 301277
REVIEW:105182
FIXED-IN:2.4.3

M  +34   -0    kexi/doc/dev/CHANGELOG-Kexi-js
M  +18   -2    kexi/kexidb/connection.cpp
M  +1    -0    kexi/kexidb/driver.cpp
M  +7    -0    kexi/kexidb/driver_p.h
M  +8    -1    kexi/kexidb/drivers/mySQL/mysqlconnection_p.cpp
M  +2    -0    kexi/kexidb/drivers/mySQL/mysqldriver.cpp

http://commits.kde.org/calligra/366d03dbbf73d7773235b4ee45be99d5b02b33bf
Comment 6 Yue Liu 2012-06-13 09:51:35 UTC
Git commit bb65aa5fe7cc9121b04942c569e2d2c9ba1ca955 by Yue Liu, on behalf of Jaroslaw Staniek.
Committed on 08/06/2012 at 01:35.
Pushed by liu into branch 'connection-interaction-yue'.

Set limit to 255 for Text type in MySQL Driver

MySQL Driver:
*set limit to 255 characters for Text type (VARCHAR)
*call "SET SESSION sql_mode='TRADITIONAL'" on opening database - needed to turn warnings about trimming string values into SQL errors
*practical solution for 'Kexi shows no indication that text is trimmed' bug in case of MySQL: error is displayed eg. "Record inserting on the server failed.Message from server: Data too long for column 'hn' at row 1. SQL statement: INSERT INTO table4 (hn) VALUES ('...................'). Server result: 1406"

More info on VARCHAR support in databases: http://www.ispirer.com/wiki/sqlways/mysql/data-types/varchar_n
Related: bug 301277
REVIEW:105182
FIXED-IN:2.4.3

M  +12   -2    kexi/doc/dev/CHANGELOG-Kexi-js
M  +18   -2    kexi/kexidb/connection.cpp
M  +1    -0    kexi/kexidb/driver.cpp
M  +7    -0    kexi/kexidb/driver_p.h
M  +8    -1    kexi/kexidb/drivers/mySQL/mysqlconnection_p.cpp
M  +2    -0    kexi/kexidb/drivers/mySQL/mysqldriver.cpp

http://commits.kde.org/calligra/bb65aa5fe7cc9121b04942c569e2d2c9ba1ca955
Comment 7 Jarosław Staniek 2012-06-29 20:40:26 UTC
Git commit 0a7667c32063831fff3c8e6ba9346d061cf56191 by Jaroslaw Staniek.
Committed on 29/06/2012 at 22:37.
Pushed by staniek into branch 'master'.

Set limit to 255 for Text type in MySQL Driver

*set limit to 255 characters for Text type (VARCHAR)
*call "SET SESSION sql_mode='TRADITIONAL'" on opening database - needed to turn warnings about trimming string values into SQL errors
*practical solution for 'Kexi shows no indication that text is trimmed' bug in case of MySQL: error is displayed eg. "Record inserting on the server failed.Message from server: Data too long for column 'hn' at row 1. SQL statement: INSERT INTO table4 (hn) VALUES ('...................'). Server result: 1406"
*More info on VARCHAR support in databases: http://www.ispirer.com/wiki/sqlways/mysql/data-types/varchar_n
*(2012-06-08 calligra master commit da2bf9b689e)
Related: bug 301277

M  +9    -2    Drivers/mysql/MysqlConnection_p.cpp
M  +2    -0    Drivers/mysql/MysqlDriver.cpp
M  +18   -2    Predicate/Connection.cpp
M  +2    -1    Predicate/Driver_p.cpp
M  +8    -1    Predicate/Driver_p.h

http://commits.kde.org/predicate/0a7667c32063831fff3c8e6ba9346d061cf56191
Comment 8 Jarosław Staniek 2012-11-07 23:39:18 UTC
Git commit 5a045908fb47dec17f28af77754ae553061a4195 by Jaroslaw Staniek.
Committed on 27/10/2012 at 01:52.
Pushed by staniek into branch 'calligra/2.6'.

Tables/Forms: show indication that edited or pasted text is trimmed
REVIEW:107068
DIGEST:Kexi shows indication that edited or pasted text is trimmed, more at http://blogs.kde.org/2012/10/27/kexi-26-text-trimming

M  +36   -1    kexi/core/kexidataiteminterface.cpp
M  +22   -1    kexi/core/kexidataiteminterface.h
M  +11   -1    kexi/plugins/forms/kexiformscrollview.cpp
M  +7    -1    kexi/plugins/forms/kexiformscrollview.h
M  +25   -9    kexi/plugins/forms/widgets/kexidblineedit.cpp
M  +11   -6    kexi/plugins/forms/widgets/kexidblineedit.h
M  +94   -31   kexi/widget/dataviewcommon/kexidataawareobjectiface.cpp
M  +18   -1    kexi/widget/dataviewcommon/kexidataawareobjectiface.h
M  +22   -10   kexi/widget/tableview/kexiinputtableedit.cpp
M  +3    -1    kexi/widget/tableview/kexiinputtableedit.h
M  +12   -1    kexi/widget/tableview/kexitableview.cpp
M  +6    -0    kexi/widget/tableview/kexitableview.h
M  +37   -9    kexi/widget/tableview/kexitextformatter.cpp
M  +5    -2    kexi/widget/tableview/kexitextformatter.h

http://commits.kde.org/calligra/5a045908fb47dec17f28af77754ae553061a4195
Comment 9 Jarosław Staniek 2012-11-07 23:40:57 UTC
Git commit c4bf842347421f20b75463932e4147e14cda96ae by Jaroslaw Staniek.
Committed on 27/10/2012 at 01:52.
Pushed by staniek into branch 'master'.

Tables/Forms: show indication that edited or pasted text is trimmed
REVIEW:107068
DIGEST:Kexi shows indication that edited or pasted text is trimmed, more at http://blogs.kde.org/2012/10/27/kexi-26-text-trimming

M  +36   -1    kexi/core/kexidataiteminterface.cpp
M  +22   -1    kexi/core/kexidataiteminterface.h
M  +11   -1    kexi/plugins/forms/kexiformscrollview.cpp
M  +7    -1    kexi/plugins/forms/kexiformscrollview.h
M  +25   -9    kexi/plugins/forms/widgets/kexidblineedit.cpp
M  +11   -6    kexi/plugins/forms/widgets/kexidblineedit.h
M  +94   -31   kexi/widget/dataviewcommon/kexidataawareobjectiface.cpp
M  +18   -1    kexi/widget/dataviewcommon/kexidataawareobjectiface.h
M  +22   -10   kexi/widget/tableview/kexiinputtableedit.cpp
M  +3    -1    kexi/widget/tableview/kexiinputtableedit.h
M  +12   -1    kexi/widget/tableview/kexitableview.cpp
M  +6    -0    kexi/widget/tableview/kexitableview.h
M  +37   -9    kexi/widget/tableview/kexitextformatter.cpp
M  +5    -2    kexi/widget/tableview/kexitextformatter.h

http://commits.kde.org/calligra/c4bf842347421f20b75463932e4147e14cda96ae