core icon indicating copy to clipboard operation
core copied to clipboard

Required field not displaying an error when edited to become null

Open jkshapiro opened this issue 11 years ago • 3 comments

This is per https://groups.google.com/forum/?fromgroups#!topic/dotcms/HZgOSQ0MLo8. To recap the steps:

  1. Log into demo.dotcms.com

  2. Create a structure with a field with the following properties:

    • Display type Text
    • Data type Whole Number
    • Validation RegEx ^(([1-9]{1}[0-9]{0,4})|100000)$
    • Default Value 5
    • Required
    • Show in listing
  3. Create a contentlet and enter any valid value

  4. Save OR Save and Publish

  5. Edit the contentlet

  6. Clear out the field so it is null

  7. Save OR Save and Publish

Result: the contentlet is saved (and the field retains its earlier value). It should instead not save, because a required field was not entered.

There is no error in the log but there is an info message:

[12/05/15 08:29:47:119 EDT] INFO web.ContentletWebAPIImpl: Unable to set field whole number to value

jkshapiro avatar May 12 '15 12:05 jkshapiro

Issue still persists Tried to clear out "Sort Order" field to become null and got the message below:

image

This time I did get an error in the logs: https://gist.github.com/shaydotcms/6c1a686ede2e476402fe0e44f694a815

Tested locally in: Win7 Pro SP1 // SQLServer 2012 // FF Mac OS 10.10 // MySQL 5.6.23 // Chrome

shaydotcms avatar Apr 25 '16 17:04 shaydotcms

@shaydotcms original issue is that a required field was allowed to be saved without any value.If you are getting that error it means it can not be saved now which is good.

dsilvam avatar Apr 25 '16 18:04 dsilvam

Added issue #8949 in regards to incorrect message

shaydotcms avatar Apr 25 '16 21:04 shaydotcms