Problem/Motivation
API page: https://api.drupal.org/api/drupal/core%21modules%21migrate%21src%21Plugi...
Isn't the second source: key redundant in the example? When chaining process plugins the plugin get as their source the processed value of the plugin before, right? As per https://www.drupal.org/docs/8/api/migrate-api/migrate-process-plugins/mi... :
"The second plugin and so on does not need a source as their input is the output of the previous plugin. This is why it's called a pipeline."
Is this just a confusing (i.e. 'bad') example or is there something else going on here?
plugin: substr
source: some_text_field <-- this seems redundan
Steps to reproduce
N/A
Proposed resolution
Remove the line * source: some_text_field
from the substr process in this example, not from skip_on_empty.
* process:
* new_text_field:
* -
* plugin: skip_on_empty
* method: process
* source: some_text_field
* -
* plugin: substr
* source: some_text_field
* start: 6
* length: 10
Remaining tasks
Patch
review
commit
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Release notes snippet
N/A
Comment | File | Size | Author |
---|---|---|---|
#12 | interdiff_2989893_9-12.txt | 427 bytes | ankithashetty |
#12 | 2989893-12.patch | 467 bytes | ankithashetty |
#9 | 2989893-9.patch | 533 bytes | srilakshmier |
Comments
Comment #5
quietone CreditAttribution: quietone as a volunteer commentedYes, this could be improved. The documentation is not incorrect though, the given example does work. It just doesn't make use of the abilities of the pipeline process.
Comment #6
quietone CreditAttribution: quietone as a volunteer commentedForgot to tag.
Comment #7
quietone CreditAttribution: quietone as a volunteer commentedComment #8
srilakshmier CreditAttribution: srilakshmier at Valuebound for Valuebound commentedComment #9
srilakshmier CreditAttribution: srilakshmier at Valuebound for Valuebound commentedAttaching the patch.
Thanks
Comment #10
longwaveWe shouldn't be removing the first instance of this line - the first plugin in the chain needs a source field.
Comment #11
quietone CreditAttribution: quietone as a volunteer commentedClarified the resolution.
Comment #12
ankithashettyUpdated patch in #9 addressing #10, thanks!
Comment #13
longwaveThanks!
Comment #16
catchCommitted/pushed to 9.3.x and cherry-picked to 9.2.x, thanks!