mampf icon indicating copy to clipboard operation
mampf copied to clipboard

Form input of too large integers

Open fosterfarrell9 opened this issue 4 years ago • 0 comments

I just discovered in the server logs that there is problem when user entered integer values in forms are too big to be actual integers, e.g. in the form that contains the submission grace period. If you enter someting like 1000000000000000000000000000000000000000000 in there, you will get an ActiveModel::RangeError (1000000000000000000000000000000000000000000 is out of range for ActiveModel::Type::Integer with limit 4 bytes). The update (in this case of the lecture) is rolled back, but the error object contains an empty message hash. So, no error message is displayed, and since it is all via ajax, the 500 error will be shown on the browser console. That will probably apply to all forms with integer input.

fosterfarrell9 avatar Oct 20 '20 16:10 fosterfarrell9