2

I am seeing this error:

Value is invalid, it does not match the correct pattern

When I set a regex pattern in the doctype "Generic Properties" on something that is optional.

For example I setup a new UmbracoCMS 7.2.1 using Nuget with Visual Studio 2013 and after all the auto configuration/setup I went to the settings and added a regex to a new "optional" property called "title". Now when I go into "Content" and try to publish a page with the "TextPage" doctype (leaving the "Title" field blank) it returns the above error after postback for the "Title" field, even though the "Mandatory" checkbox is unchecked. Is there a work around for this ?

I first encountered this error in an existing Umbraco site that I just upgraded from v4 to v7.2 and I thought something had corrupted the templates but it doesn't seem to be the case.

Any help will be appreciated.

M Khan
  • 225
  • 1
  • 4
  • 14

1 Answers1

0

By providing a regular expression for the field you in turn make it mandatory. If you wish for the field to be optional then you must either omit your regular expression or alter it so that it also accepts an empty value.

jezzipin
  • 4,110
  • 14
  • 50
  • 94
  • Thanks, I was thinking about doing this as well but haven't tried it out yet. This shouldn't occur though, hopefully it is fixed in a future update. – M Khan Jan 21 '15 at 17:34
  • I doubt it will be to be honest. This was always the way in which this functionality was intended to be used. – jezzipin Jan 22 '15 at 10:01