Skip to content

Added a maxlength setting to the regular expression pattern field#17982

Merged
Migaroez merged 1 commit intov13/devfrom
v13/bugfix/prevent-too-long-validation-pattern
Jan 15, 2025
Merged

Added a maxlength setting to the regular expression pattern field#17982
Migaroez merged 1 commit intov13/devfrom
v13/bugfix/prevent-too-long-validation-pattern

Conversation

@AndyButland
Copy link
Copy Markdown
Contributor

@AndyButland AndyButland commented Jan 14, 2025

Prerequisites

  • I have added steps to test this contribution in the description below

Fixes: #16368

Description

Currently the regular expression pattern field allows entry of any length of text. On SQL Server, the limit is 255 characters, so you'll get an exception thrown if you try to enter a longer pattern. With SQLite, the longer text is accepted, but then errors will occur if you deploy to an environment running SQL Server.

This PR adds a maxlength attribute to the field to prevent entry of a value that's too long.

I've also increased the height of the box slightly to better present longer patterns.

This resolves the issue for Umbraco 13. Will check and if necessary create a separate PR for the same on Umbraco 15.

@AndyButland
Copy link
Copy Markdown
Contributor Author

Hi @Migaroez - I assigned you this one if that's OK please (as it's for 13.6). Please don't close the linked issue though, as I have a WIP PR for resolving for 15.

@Migaroez
Copy link
Copy Markdown
Contributor

Hi @Migaroez - I assigned you this one if that's OK please (as it's for 13.6). Please don't close the linked issue though, as I have a WIP PR for resolving for 15.

You should retarget it to the 13.6 release branch then ;)

@AndyButland AndyButland changed the base branch from v13/dev to release/13.6 January 15, 2025 12:59
@AndyButland AndyButland changed the base branch from release/13.6 to v13/dev January 15, 2025 12:59
Copy link
Copy Markdown
Contributor

@Migaroez Migaroez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, works as described and makes sense 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants