File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -148,14 +148,19 @@ private function sanityCheck()
148148 $ this ->fieldsToMigrate = $ this ->source ->getFields ();
149149 }
150150
151+ $ postDotFieldsToMigrate = array_map (function ($ field ) {
152+ $ fieldParts = explode ('. ' , $ field );
153+ return end ($ fieldParts );
154+ }, $ this ->fieldsToMigrate );
155+
151156 foreach (array_keys ($ this ->fieldMap ) as $ sourceField ) {
152- if (!in_array ($ sourceField , $ this ->fieldsToMigrate )) {
157+ if (!in_array ($ sourceField , $ this ->fieldsToMigrate ) && ! in_array ( $ sourceField , $ postDotFieldsToMigrate ) ) {
153158 throw new MissingFieldToMigrateException ('The source field ` ' .$ sourceField .'` is present in the field map but not present in the fields to migrate. ' );
154159 }
155160 }
156161
157162 foreach ($ this ->keyFields as $ keyField ) {
158- if (!in_array ($ keyField , $ this ->fieldsToMigrate )) {
163+ if (!in_array ($ keyField , $ this ->fieldsToMigrate ) && ! in_array ( $ keyField , $ postDotFieldsToMigrate ) ) {
159164 throw new MissingFieldToMigrateException ('The field ` ' .$ keyField .'` is present in the key fields list but not present in the fields to migrate. ' );
160165 }
161166 }
You can’t perform that action at this time.
0 commit comments