Problem/Motivation
TermTranslation and TermLocalizedTranslation are not caring of the return value of their parent's prepareRow() method which means that it is impossible to skip rows by returning FALSE in hook_migrate_prepare_row() implementations (note that SourcePluginBase::prepareRow() invokes these hooks).
See SourcePluginBase::prepareRow().
Proposed resolution
Return FALSE whenever parent::prepareRow() returns FALSE.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | core-term_translation_ignored_preparerow_return_value-3187426-7.patch | 1.31 KB | huzooka |
Comments
Comment #2
huzookaComment #3
huzookaComment #4
huzookaComment #5
quietone commentedIt might be prudent to check all source plugins for this problem.
Comment #6
huzookaAdded a new meta: #3187433: Eliminate parent::prepareRow() calls with ignored return value from all migrate source plugins.
Comment #7
huzookaComment #8
huzookaComment #9
wim leersThis clearly ignores the
MigrateSkipRowExceptionthat is caught in\Drupal\migrate\Plugin\migrate\source\SourcePluginBase::prepareRow(), which is the parent implementation that is called eventually in both cases here.Comment #10
catchIs there any existing test coverage where a line or two could be added for this? I'm not sure it's worth adding new test coverage from scratch given the bug is in the specific implementation.
Comment #11
quietone commented@catch, alexpott has done just that, in the meta for this #3187433: Eliminate parent::prepareRow() calls with ignored return value from all migrate source plugins. Since that will find all the source plugins that have this problem I think this can be closed as a duplicate and all the necessary changes made in the meta. And patch over there is a manageable size, ~10K, so I don't see a reason to keep this issue.
Comment #12
quietone commentedYes, closing this as a duplicate.