Details
-
Bug
-
Resolution: Fixed
-
Medium
-
5.0.0-dev
-
None
-
Operating System: RHEL 62
PHP Version: 5.3.3
Database and version:5.1.61
Browser N/A
Description
Using the API, when creating a ContentType with a Relation FieldType attribute (FieldDefinition), defining the attribute as not required (->isRequired = false ), and then attempting to create an object of that ContentType without explicitly providing a value to the attribute will yield the following RuntimeException:
`RuntimeException: $destinationContentId can not be of value null`
This issue may be related to #19645, as it'll occur even if a defaultValue is provided for the FieldDefinition.
Steps to reproduce
1. Create a ContentType with a Relation FieldDefinition
2. Set the Relation FieldDefinition to NOT be required, you may provide a defaultValue or not.
3. Attempt to create an object of the ContentType you created without explicitly setting the Relation field value.