Issue Details (XML | Word | Printable)

Key: MDL-13855
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Jamie Pratt
Reporter: Eloy Lafuente (stronk7)
Votes: 0
Watchers: 6
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Submit fields lenght isn't ever checked

Created: 09/Mar/08 10:18 AM   Updated: 21/Oct/09 04:17 PM
Return to search
Component/s: Forms Library
Affects Version/s: 1.9
Fix Version/s: 1.9.7

Issue Links:
Dependency
 
Relates
 

Database: Oracle
Participants: Eloy Lafuente (stronk7) and Jamie Pratt
Security Level: None
Affected Branches: MOODLE_19_STABLE
Fixed Branches: MOODLE_19_STABLE


 Description  « Hide
It seems that a lot of forms, have some input text fields whole maxsize isn't specified (for example, all module names, or resource->reference...), so it's possible to introduce values over the DB size of the field.

Some DBs automatically use to truncate the data, allowing to insert it (incorrect behaviour IMO). And others directly drop an error.

IMO we should (to do so in a proper way):

1) Think how we can add something like "format-masks" in formslib. It should be able to specify things like: max length, number of digits and decimals (for numbers).
2) The form constructor must understand this formats and apply the corresponding "maxsize" and client validations.
3) The form checked must apply those formats and show error if something isn't fulfilled.

Also, we can make a quicker fix that consists, basically, on examine as many forms as possible, applying the "maxsize" property to match the DB max length.

This second approach is imperfect (nothing is validated at server level) but for sure, it's better that allowing an unlimited number of chars to arrive straight to DB.

Perhpas we could apply the imperfect approach to 19_STABLE and plan the proper one, needs further discussion and important changes, for 2.0.

Any comment is welcome. Ciao :-)

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Eloy Lafuente (stronk7) made changes - 09/Mar/08 10:20 AM
Field Original Value New Value
Link This issue will help resolve MDL-13826 [ MDL-13826 ]
Martin Dougiamas made changes - 15/May/08 03:02 PM
Fix Version/s 1.9.2 [ 10280 ]
Fix Version/s 1.9.1 [ 10240 ]
Petr Skoda made changes - 05/Jul/08 09:11 PM
Fix Version/s 1.9.2 [ 10280 ]
Fix Version/s 2.0 [ 10122 ]
Fix Version/s 1.9.3 [ 10290 ]
Martin Dougiamas made changes - 15/Oct/08 03:00 PM
Fix Version/s 1.9.4 [ 10300 ]
Fix Version/s 1.9.3 [ 10290 ]
Petr Skoda made changes - 22/Jan/09 07:49 AM
Fix Version/s 1.9.4 [ 10300 ]
Fix Version/s 1.9.5 [ 10320 ]
Petr Skoda made changes - 06/May/09 11:37 PM
Fix Version/s 1.9.5 [ 10320 ]
Fix Version/s 1.9.6 [ 10340 ]
Eloy Lafuente (stronk7) made changes - 08/May/09 04:27 AM
Link This issue has been marked as being related by MDL-19112 [ MDL-19112 ]
Martin Dougiamas made changes - 21/Oct/09 04:17 PM
Fix Version/s 1.9.7 [ 10360 ]
Fix Version/s 1.9.6 [ 10340 ]