Skip to content

Fields do not validate field length #1478

@mattbrailsford

Description

@mattbrailsford

Which Umbraco Forms version are you using? (Please write the exact version, example: 13.4.0)

13.6.0

Which Umbraco version are you using? (Please write the exact version, example: 13.5.2)

13.0.0

Issue summary

If a field type exceeds the maximum length of the db column for the field types data type this should be captured in the ValidateField call.

Specifics

Hidden fields use a FieldDataType.String which is persisted in the UFRecordDataString table, in which the value column is limited to 255 characters. However there's no corresponding validation rule for this in the field type.

We should update the base ValidateField to automatically validate field values for their expected data types length and throw appropriate validation errors.

Steps to reproduce

  • Create a form with a text string input
  • Enter more than 225 character (the data types DB limit)
  • See DB exception rather than Validation exception

Expected result / actual result

I'd expect a validation exception to be thrown


This item has been added to our backlog AB#61364

Metadata

Metadata

Assignees

No one assigned

    Labels

    state/sprint-candidateWe're trying to get this in a sprint at HQ in the next few weekstype/bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions