Skip to content
Snippets Groups Projects
Verified Commit 91baefec authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3285637 by mikelutz, danflanagan8, benjifisher: 'Get' Process plugin should handle multiple

parent 616d5e09
No related branches found
No related tags found
No related merge requests found
......@@ -88,7 +88,8 @@
* @see \Drupal\migrate\Plugin\MigrateProcessInterface
*
* @MigrateProcessPlugin(
* id = "get"
* id = "get",
* handle_multiples = TRUE
* )
*/
class Get extends ProcessPluginBase {
......
......@@ -71,6 +71,32 @@ public function getDefinition() {
'delimiter' => '/',
],
],
// Process pipeline for testing 'get' overriding a single.
'get_from_single' => [
// Returns a string.
[
'plugin' => 'get',
'source' => 'scalar',
],
// Ignore previous and return an array.
[
'plugin' => 'get',
'source' => 'multiple',
],
],
// Process pipeline for testing 'get' overriding an array.
'get_from_multiple' => [
// Returns an array.
[
'plugin' => 'get',
'source' => 'multiple',
],
// Ignore previous and return a string.
[
'plugin' => 'get',
'source' => 'scalar',
],
],
],
'destination' => [
'plugin' => 'config',
......@@ -131,6 +157,11 @@ public function scalarAndMultipleValuesProviderSource() {
'BAR',
'BAZ',
],
'get_from_single' => [
'foo',
'bar/baz',
],
'get_from_multiple' => 'foo/bar',
],
],
];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment