diff --git a/Core/ComplexField/EzBinaryFile.php b/Core/ComplexField/EzBinaryFile.php index 994b6b1..9466b3c 100644 --- a/Core/ComplexField/EzBinaryFile.php +++ b/Core/ComplexField/EzBinaryFile.php @@ -16,7 +16,10 @@ class EzBinaryFile extends AbstractComplexField implements ComplexFieldInterface { $mimeType = ''; $fileName = ''; - if (is_string($fieldValue)) { + + if ($fieldValue === null) { + return new BinaryFileValue(); + } if (is_string($fieldValue)) { $filePath = $fieldValue; } else { $filePath = $fieldValue['path']; diff --git a/Core/ComplexField/EzImage.php b/Core/ComplexField/EzImage.php index dc4b52b..ff739f0 100644 --- a/Core/ComplexField/EzImage.php +++ b/Core/ComplexField/EzImage.php @@ -18,7 +18,10 @@ class EzImage extends AbstractComplexField implements ComplexFieldInterface { $altText = ''; $fileName = ''; - if (is_string($fieldValue)) { + + if ($fieldValue === null) { + return new ImageValue(); + } else if (is_string($fieldValue)) { $filePath = $fieldValue; } else { $filePath = $fieldValue['path']; diff --git a/Core/ComplexField/EzRelation.php b/Core/ComplexField/EzRelation.php index e4c4e17..5f3d5ad 100644 --- a/Core/ComplexField/EzRelation.php +++ b/Core/ComplexField/EzRelation.php @@ -32,6 +32,10 @@ class EzRelation extends AbstractComplexField implements ComplexFieldInterface $id = $fieldValue; } + if ($id === null) { + return new Value(); + } + // 1. resolve relations $id = $this->referenceResolver->resolveReference($id); // 2. resolve remote ids diff --git a/Core/MigrationService.php b/Core/MigrationService.php index b7f3633..fd6dec3 100644 --- a/Core/MigrationService.php +++ b/Core/MigrationService.php @@ -351,6 +351,11 @@ class MigrationService } } } + + while (($e = $e->getPrevious()) != null) { + $message .= "\n" . $e->getMessage(); + } + return $message; } } diff --git a/Tests/dsl/good/UnitTestOK004_content.yml b/Tests/dsl/good/UnitTestOK004_content.yml index d912e10..e5e1532 100644 --- a/Tests/dsl/good/UnitTestOK004_content.yml +++ b/Tests/dsl/good/UnitTestOK004_content.yml @@ -207,6 +207,36 @@ destinationContentId: 'reference:kmb_test_2_1' - ezobjectrelationlist: destinationContentIds: [ 'reference:kmb_test_2_1', 'reference:kmb_test_2_2' ] + +- + type: content + mode: create + content_type: kmb_test_2 + parent_location: 2 + attributes: + ezstring: null + ezauthor: null + ezbinaryfile: null + ezboolean: null + ezcountry: null + ezdatetime: null + ezdate: null + ezemail: null + ezfloat: null + ezimage: null + ezinteger: null + ezisbn: null + ezkeyword: null + ezmedia: null + ezobjectrelation: null + ezobjectrelationlist: null + ezrichtext: null + eztext: null + eztime: null + ezurl: null + ezuser: null + ezxmltext: null + - type: content mode: update