-
Type:
Service Pack Request
-
Status: Open
-
Resolution: Unresolved
-
Affects Version/s: 6.2
-
Fix Version/s: 6.2.N
-
Component/s: ACS REST API
-
Labels:None
-
Bug Priority:
-
ACT Numbers:
01014264
-
Epic Link:
Description
When creating a node via the REST API, it's possible to set a date with a 5-digit year (e.g. 20202-09-02) for date properties. This causes an error pop-up and UI issues in Share and is inconsistent with creating a node via the UI where a date like this is flagged as invalid.
Steps to reproduce
- Create a new node via the REST API, sending a POST request for example to
http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/-my-/children
with the following data:
{ "name":"WrongDate", "nodeType":"cm:content", "properties": { "cm:created": "20202-09-02" } }
(Note: The observed behavior is the same whether the cm:created property or a custom date property is set to a value like this. cm:created is suggested to test this without the need for adding a custom property to the content model)
- Inspect the created node in Share and in the Node Browser
Expected Behaviour
The REST API should return an error instead of creating the node, consistent with Share where the property value will not be saved when a date in this format is entered (see attached screenshot "share_error.png")
Observed Behaviour
The node is created with the created date set to the year 20202, this value can be seen in the Node Browser and database (see attached screenshot "NodeBrowser.png").
When opening the document in Share, there is a pop-up saying "Failure" and none of the properties of the node are displayed (see attachments "Failure_popup.png" and "properties.png"). The share.log file shows an error similar to "Failed to parse date 20201-08-27T00:00:00.000+01:00" (see attached).