Hello,
I'm migrating data from an open atrium to another. I want to import nodes from a certain content type with Migrate. But when I migrate with drush, I got this error :
Field validation errors
(/path/profiles/openatrium/modules/contrib/og/plugins/entityreference/behavior/OgBehaviorHandler.class.php:290)
The problem is the og_group_ref. The workspaces already exist in the open atrium, so I don't need to migrate the groups. I just need to migrate the nodes and map the og_group_ref with the existing workspaces.
Here is the query when I search the id of a workpace:
$query = Database::getConnection('default', 'bddebug')
->select('node', 'n')
->fields('n', array('nid', 'title', 'uid', 'status', 'created', 'changed', 'comment', 'promote'));
$query->condition('n.nid', '182', '=');
$query->leftJoin('og_membership', 'ogm', 'ogm.etid = n.nid and ogm.entity_type = :type', array(':type' => 'node'));
$query->fields('ogm',array('gid'));
And the mapping :
$this->addFieldMapping('og_group_ref','gid');
The admin is member of the group, so it's not a problem of member who doesn't belong to the group.
Does somebody knows what should I do ? Thanks in advance for your help.
Comments
Comment #1
hefox CreditAttribution: hefox at Phase2 commentedThis doesn't sound like a bug in oa itself yet, so marking it as a support request
is the validation expectations ... what's the actual errors happening?
Comment #2
GillianD CreditAttribution: GillianD commentedThanks for your reply. My problem was that I wanted to map my new nodes with workspaces that already exist (not created with Migrate, so I couldn't use "sourceMigration"). The workspaces from the two open atrium didn't have the same nid. The actual error was that I didn't use the good id for og_group_ref, so it throws that exception.
I bypass the problem by writing a script that uses queries to find the concordance between the workspaces of the two open atrium and edit the og_group_ref after the migrate.
Comment #3
hefox CreditAttribution: hefox at Phase2 commentedsounds fixed then?