Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Bug]: the default value is not used for mandatory fields #15311

@youwe-petervanderwal

Description

@youwe-petervanderwal

Expected behavior

The default value is set on the (newly created) DataObject

Actual behavior

Pimcore\Model\Element\ValidationException: Empty mandatory field [ fieldName ]

Steps to reproduce

With (currently latest versions) Pimcore v10.5.20, DataHub v1.5.6 and DataImporter v1.7.5

  1. Create a class definition, with
    a. Mark one field as mandatory field and also give it a default value (e.g. a status dropdown with default value "New")
  2. Create a data importer definition, with
    a. Resolver configuration with a valid "Element Creation" config
    b. Resolver configuration publish strategy set to "Always publish" or "Publish new"
    c. Valid mapping configuration so that it can create new DataObjects (mainly, the system key should be set)
    d. Important: don't map the field created in step 1a.
  3. Run an import

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions