Something isn't quite right with the term migration between 5 and 7. I have the following vocab in Drupal 5:
Term 1
-- Term 2
-- -- Term 3
-- -- Term 4
-- Term 5
-- -- Term 6
-- -- Term 7
When I migrate it across I get the following:
Term 1
Term 3
Term 4
-- Term 2
-- Term 5
-- -- Term 6
-- -- Term 7
For some reason terms under Term 2 are not respecting there parent. Outputting the $row from prepareRow() shows that the correct parent is assigned but in the new D7 term hierarchy they are assigned to 0. It's really odd that terms under Term 5 are migrated correctly. The one thing that does stand out is that the tid of the sub terms are higher lower than the container (Term 2). Also this is the first set of terms that are nested 3 deep.
Comments
Comment #1
mikeryanNothing to do specifically with D5 - to set the parent of a term properly, the parent must have already been migrated. So, if a term pops up in the migration before its parent, it won't get a parent. We order the term migration by parent so terms with no parent come first, which will work just fine with a 2-deep hierarchy, but beyond that all bets are off.
We should add a createStub() method, so parent stubs get created and ultimately the hierarchy is preserved.
Comment #2
mikeryanBetter title.
Comment #3
philipz CreditAttribution: philipz commentedThat title was really misleading I looked at it few times and haven't entered it :)
I just checked and this problem can be fixed by migrating two times and using --update the second time. That second time gets the hierarchy in order.
I did that with Feeds some time ago and that did the trick too.
Anyway the createStub is the right approach and I'll try to make patch today.
Comment #4
philipz CreditAttribution: philipz commentedI failed to make
createStub
implementation for terms. Maybe later when I'll understand the whole migration classes registration better.For now the double import with --update option is the solution for me:)
Comment #5
jacktonkin CreditAttribution: jacktonkin commentedThe following subclass works for me migrating a 3-level vocabulary from Drupal 6. Might be suitable to simply add this createStub() implementation to DrupalTermMigration?
Comment #6
Summit CreditAttribution: Summit commentedHi, did this also work for Drupal 5 - Drupal 7 migration?
greetings, Martijn
Comment #7
mikeryanOK, I've added a createStub() to the base class, this should work fine now.