Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-19646

Public API: "$destinationContentId can not be of value null" for Relation FieldDefinition even when it's not required

    XMLWordPrintable

Details

    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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            filiped filiped
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 30 minutes
                30m