mirror of
https://github.com/jbcr/ezmigrationbundle.git
synced 2026-03-28 02:32:13 +01:00
More verbose error messages; make sure that a NULL attribute value is accepted by all field types
This commit is contained in:
@@ -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'];
|
||||
|
||||
@@ -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'];
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -351,6 +351,11 @@ class MigrationService
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
while (($e = $e->getPrevious()) != null) {
|
||||
$message .= "\n" . $e->getMessage();
|
||||
}
|
||||
|
||||
return $message;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user