After upgrading to the latest dev version, all my migrations that use the MigrateDestinationRelation class began throwing informational messages like those in the issue title. It seems as if relation_save() now expects all incoming entities to have the uid property defined.

Comments

mikran’s picture

It has to be #1716964: uid not set when migrating *reference fields, did you choose owner for imported relations?

jpklein’s picture

Status: Active » Needs review
StatusFileSize
new1 KB

Here's a patch that ensures that the uid property is defined and set to the current account's id if empty.

jpklein’s picture

@mikran - hmm... it looks like the patch you referenced was already included in my production code, but I still got this error. So, even if I don't change the setting, it should default to user 1 and set the uid field accordingly. But for some reason, the uid field-mapping isn't making it into the $relation object that gets passed to MigrateDestinationRelation::import().... Feel free to investigate further, but this patch seems to be working for me and in the spirit of the existing code.

mikran’s picture

Yea, I just wanted to point out that relation_save was not changed at all. The patch looks good to me, but I'm not too familiar with the migrate classes.

slashrsm’s picture

Status: Needs review » Reviewed & tested by the community

This looks good.

mikran’s picture

Status: Reviewed & tested by the community » Fixed

The patch is now committed

Status: Fixed » Closed (fixed)

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