Bug report #2534
avoid the possibility to enter -in attributes table- strings/numbers beyond the field length
|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|
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.
#4 Updated by Jürgen Fischer over 10 years ago
Replying to [comment:4 sunilkcube]:
I have attached the patch file, Kindly reply your comments.
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 10 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?.