Last active
October 26, 2016 15:27
-
-
Save jmolivas/c998089c6ccfcebcb1b255c5ac51d928 to your computer and use it in GitHub Desktop.
Drupal 8 migration validate `NULL` since is read as string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// ... | |
public function onPrepareRow(MigratePrepareRowEvent $event) { | |
$row = $event->getRow(); | |
$fields = $event->getMigration()->getPluginDefinition()['process']; | |
foreach ($fields as $destination => $source) { | |
if (!is_array($destination) && !is_array($source)) { | |
if ($row->getSourceProperty($source) == "NULL") { | |
$row->setSourceProperty($source, NULL); | |
} | |
} | |
} | |
} | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@heddn awesome I will make the changes and reply you back.