The migrate module was recently updated on a site I support from version 7.x-2.5 to 7.x-2.8. I was no longer able to import taxonomy terms after the update.

Old Code:

This was giving me an error regarding the arguments() method being deprecated.

$this->addFieldMapping('parent', 'parent_id')
                ->arguments(array('source_type' => 'tid'))
                ->sourceMigration($this->machineName); 

New Code (this worked - based on the wine example in wine.inc):

$this->addFieldMapping('parent', 'parent_id')
                ->sourceMigration($this->machineName); 

I spent some time trying to figure out how to set the source type without using the arguments() method, and I kept getting the following error:

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'parent' cannot be null: INSERT INTO    [error]
{taxonomy_term_hierarchy} (tid, parent) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1);.  

It wasn't until I checked the beer and wine examples that I discovered in this case, it's no longer needed. I hope this saves someone some time.

Comments

ann b created an issue. See original summary.

mikeryan’s picture

Status: Active » Closed (works as designed)