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

hefox’s picture

Category: Bug report » Support request

This doesn't sound like a bug in oa itself yet, so marking it as a support request

    if ($new_errors) {
      og_field_widget_register_errors($field_name, $new_errors);
      // We throw an exception ourself, as we unset the $errors array.
      throw new FieldValidationException($new_errors);
    }

is the validation expectations ... what's the actual errors happening?

GillianD’s picture

Thanks 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.

hefox’s picture

Status: Active » Fixed

sounds fixed then?

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.