Bug report #2534
avoid the possibility to enter -in attributes table- strings/numbers beyond the field length
Status: | Closed | ||
---|---|---|---|
Priority: | Low | ||
Assignee: | sunilkcube - | ||
Category: | Vectors | ||
Affected QGIS version: | Regression?: | No | |
Operating System: | All | Easy fix?: | No |
Pull Request or Patch supplied: | Resolution: | fixed | |
Crashes QGIS or corrupts data: | Copied to github as #: | 12594 |
Description
Actually you can enter values in the attributes table with a length that is > of the field length. This can be source of problems as a users can be mislead to believe the field has room for more chars/numbers than has really.
Fixing this will also indirectly fix another bug:
if the attributes table has only one row and you edit it, if you enter a value that has more chars/numbers than allowed by the field length, when you toggle editing to save changes, the value is not immediately truncated leading to believe that that particular edit went fine.
History
#1 Updated by Volker Fröhlich almost 14 years ago
The second part of the issue seems to be solved with 1.6.
#2 Updated by sunilkcube - over 13 years ago
- Status changed from Open to In Progress
#3 Updated by sunilkcube - over 13 years ago
I have attached the patch file, Kindly reply your comments.
#4 Updated by Jürgen Fischer over 13 years ago
Replying to [comment:4 sunilkcube]:
I have attached the patch file, Kindly reply your comments.
Looks good.
Just two things:
1. the validator only returns Invalid or Acceptable, while the child validators might als return Intermediate.
2. There doesn't seem to be support for (the configurable string representation of) NULL. If the value is some not yet complete part of NULL the validator should also return Intermediate and ignore the size limitations in that case.
#5 Updated by sunilkcube - over 13 years ago
Replying to [comment:5 jef]:
Thank you very much for your valuable comments. I have attached a new patch file. Can you kindly verify whether the file carries all the necessary changes you have mentioned above and Will you please reply me in case of further changes?.
#6 Updated by Jürgen Fischer over 13 years ago
- Resolution set to fixed
- Status changed from In Progress to Closed
applied heavly modified in 71c6454e (SVN r15567). Thanks.