Nodechanges helpfully creates a comment for each node revision. During data migrations, we often want to update an existing comment instead of creating a new one. So, if $node->revision_cid is set on the node, it's value should be copied to $comment->cid so that comment->save() performs an update instead of create.

Comments

bdragon’s picture

Status: Active » Needs review
StatusFileSize
new1.11 KB

I also will need the ability to skip generating a comment in a specific case, as well as set pid.

Here's a patch with all the stuff I need (hopefully) to get the project_issue migration stuff working.

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

senpai’s picture

Assigned: Unassigned » mikey_p
Issue tags: +project, +drupal.org D7, +sprint 8

Assigning to @mikey_p for review and a commush.

bdragon’s picture

Status: Reviewed & tested by the community » Needs work

Gimme a minute, uploading my updated patch, there ended up being more stuff I needed control over.

bdragon’s picture

Status: Needs work » Needs review
StatusFileSize
new2.41 KB

I ended up needing a lot more control over things in the migration code.

mikey_p’s picture

Status: Needs review » Fixed
StatusFileSize
new2.5 KB

Everything looks well namespaced, and even though I don't really follow all the logic here, but it seems to stay out of the way when these properties aren't set.

The only change to the patch I'm making is to move from $GLOBALS['user']->uid to use $node->revision_uid per #1694992: Remove $GLOBALS['user']->uid in favor of $node->revision_uid.

bdragon’s picture

Makes sense. Thanks.

Did a merge_project_to_site to pick it up in bzr.

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