More verbose error messages; make sure that a NULL attribute value is accepted by all field types

This commit is contained in:
gggeek
2016-11-19 16:21:08 +00:00
parent 3be5a1754d
commit cb4e4354e4
5 changed files with 47 additions and 2 deletions

View File

@@ -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'];

View File

@@ -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'];

View File

@@ -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

View File

@@ -351,6 +351,11 @@ class MigrationService
}
}
}
while (($e = $e->getPrevious()) != null) {
$message .= "\n" . $e->getMessage();
}
return $message;
}
}

View File

@@ -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