Bug report #2534

avoid the possibility to enter -in attributes table- strings/numbers beyond the field length

Added by Giovanni Manghi over 14 years ago. Updated over 13 years ago.

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.

patch_for_bug__2534.txt Magnifier (4.81 KB) sunilkcube -, 2011-03-16 02:10 AM

patch_for_bug__2534.diff Magnifier (4.81 KB) sunilkcube -, 2011-03-16 02:10 AM

patch_for_bug_2534_new.diff Magnifier - New patch file (5.27 KB) sunilkcube -, 2011-03-22 02:26 AM

Corrected_patch_for_bug__2534.diff Magnifier - Corrected patch contains all corrections mentioned by jef (5.12 KB) sunilkcube -, 2011-03-22 03:50 AM

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.

Also available in: Atom PDF