OrchardCMS / Orchard

Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform.
https://orchardproject.net
BSD 3-Clause "New" or "Revised" License
2.38k stars 1.12k forks source link

No numbers allowed in Field name #2275

Open orchardbot opened 12 years ago

orchardbot commented 12 years ago

eriklenaerts created: https://orchard.codeplex.com/workitem/18448

(using rev 5987, branch 1.x)

  1. Create a new content type
  2. Add a Field called "myfield1" -> Orchard proposes to use technical name "myfield"
  3. Hit Save
  4. Add a Field called "myfield2" -> Orchard proposes to use technical name "myfield-2"
  5. Hit Save

Validation Error: "The technical name contains invalid characters."

Imho this is a functional error. If the system proposes to name the technical field "myfield-2" itself and then in the next step doesn't accept it is kind of disappointing ;)

tip: I traced it back to the "StringExtensions.ToSafeName()" method where the class level "safe" regex does cater for numbers.

orchardbot commented 12 years ago

Gecko1986 commented:

Is there a valid reason here why numbers wouldn't be allowed for fields? Or just an oversight?