The related issue #3040239: Update step on file upload size limit made it possible to save the configuration for a file upload field with a decimal number, but I realized that the validation in the generated webform is not considering the decimal number that was set. It is rounding the number (x.0~x.4 to x, and x.5~x.9 to x+1).

Comments

jbaraldi created an issue. See original summary.

jbaraldi’s picture

Status: Active » Needs review
StatusFileSize
new822 bytes

As the call to Bytes::toInt() on a decimal number would always round it, I made the call as it is done for the webform elements settings with the unit (it was already setting the unit as MB when multiplying for 1024*1024).

renatog’s picture

Issue summary: View changes
renatog’s picture

Status: Needs review » Reviewed & tested by the community

#2 Really makes sense to me.

Good catch @jbaraldi

+1 to RTBC

@jrockowitz , what do you think?!

Good work and good weekend.

Best

  • jrockowitz committed 1ca1dbc on 8.x-5.x authored by jbaraldi
    Issue #3040581 by jbaraldi, RenatoG: Validating file size with a max...
jrockowitz’s picture

Status: Reviewed & tested by the community » Fixed

Looks good to me. I committed the patch.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.