Problem/Motivation
Currently when multiple (Drupal) migration sources are defined, and metatag is only installed in one of the sources, the migrations will be failing with an error Base table or view not found: 1146 Table "d7_site2.metatag" doesn't exist:.
This is caused by a clever static caching cleverly added to avoid checking for metatag on each row, introduced in #3190808: Do not run a "table exists" query for every migrated row of data (regardless of whether it's a metatag row or not!).
This check doesn't take in consideration that there might be multiple sources and will reuse the information only from the first migration source.
Steps to reproduce
Proposed resolution
Only statically cache the information regarding the metatag status based on the database source.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | metatag-n3247678-4.patch | 2.15 KB | damienmckenna |
| #2 | metatag--migration-multiple-source--3247678-2.patch | 1.05 KB | esolitos |
Comments
Comment #2
esolitosAdded simple patch which resets the cache if db source changes.
Comment #3
damienmckennaThanks for putting that together.
Let's see what the testbot says.
Comment #4
damienmckennaIf the migration switches back to the first source again won't it needlessly rerun the same logic? How about this?
Comment #6
damienmckennaCommitted. Thanks for raising the issue and providing a fix, esolitos.
Comment #7
damienmckennaComment #8
esolitosThanks, your patch was a better approach indeed. :)
Comment #10
wim leersMultiple sources?!