Loading src/Plugin/migrate/process/IfCondition.php +3 −4 Original line number Diff line number Diff line Loading @@ -178,9 +178,8 @@ class IfCondition extends ProcessPluginWithConditionBase { elseif (!isset($conditional_process[$destination_property]['source']) && isset($this->configuration['source'])) { $conditional_process[$destination_property]['source'] = $this->configuration['source']; } $new_row = new Row($row->getSource()); $migrate_executable->processRow($new_row, $conditional_process); return $new_row->getDestinationProperty($destination_property); $migrate_executable->processRow($row, $conditional_process); return $row->getDestinationProperty($destination_property); } } tests/src/Kernel/IfConditionTest.php +18 −0 Original line number Diff line number Diff line Loading @@ -101,6 +101,22 @@ class IfConditionTest extends KernelTestBase { 'callable' => 'strtoupper', ], ], 'dest_value_4' => [ 'plugin' => 'if_condition', 'source' => 'my_source', 'condition' => [ 'plugin' => 'contains', 'value' => 'migrate', ], 'do_process' => [ 'plugin' => 'get', 'source' => '@dest_value_3', ], 'else_process' => [ 'plugin' => 'get', 'source' => '@dest_value_2', ], ], ], 'destination' => [ 'plugin' => 'config', Loading Loading @@ -150,6 +166,7 @@ class IfConditionTest extends KernelTestBase { 'dest_value_1' => 'HI, FRIEND.', 'dest_value_2' => 'hamburger', 'dest_value_3' => 'This is a test', 'dest_value_4' => 'hamburger', ], ], [ Loading @@ -165,6 +182,7 @@ class IfConditionTest extends KernelTestBase { ], 'dest_value_2' => 'HI, FRIEND.', 'dest_value_3' => 'THIS MAKES MIGRATE FUN', 'dest_value_4' => 'THIS MAKES MIGRATE FUN', ], ], ]; Loading Loading
src/Plugin/migrate/process/IfCondition.php +3 −4 Original line number Diff line number Diff line Loading @@ -178,9 +178,8 @@ class IfCondition extends ProcessPluginWithConditionBase { elseif (!isset($conditional_process[$destination_property]['source']) && isset($this->configuration['source'])) { $conditional_process[$destination_property]['source'] = $this->configuration['source']; } $new_row = new Row($row->getSource()); $migrate_executable->processRow($new_row, $conditional_process); return $new_row->getDestinationProperty($destination_property); $migrate_executable->processRow($row, $conditional_process); return $row->getDestinationProperty($destination_property); } }
tests/src/Kernel/IfConditionTest.php +18 −0 Original line number Diff line number Diff line Loading @@ -101,6 +101,22 @@ class IfConditionTest extends KernelTestBase { 'callable' => 'strtoupper', ], ], 'dest_value_4' => [ 'plugin' => 'if_condition', 'source' => 'my_source', 'condition' => [ 'plugin' => 'contains', 'value' => 'migrate', ], 'do_process' => [ 'plugin' => 'get', 'source' => '@dest_value_3', ], 'else_process' => [ 'plugin' => 'get', 'source' => '@dest_value_2', ], ], ], 'destination' => [ 'plugin' => 'config', Loading Loading @@ -150,6 +166,7 @@ class IfConditionTest extends KernelTestBase { 'dest_value_1' => 'HI, FRIEND.', 'dest_value_2' => 'hamburger', 'dest_value_3' => 'This is a test', 'dest_value_4' => 'hamburger', ], ], [ Loading @@ -165,6 +182,7 @@ class IfConditionTest extends KernelTestBase { ], 'dest_value_2' => 'HI, FRIEND.', 'dest_value_3' => 'THIS MAKES MIGRATE FUN', 'dest_value_4' => 'THIS MAKES MIGRATE FUN', ], ], ]; Loading