Trying to migrate some data into a CCK link field. The URL transfers just find, but title is blank. Looks like function content_migrate_prepare_node() is at fault.

CommentFileSizeAuthor
#3 749102_3.patch623 bytescedarm
#1 749102_1.patch1002 bytescedarm

Comments

cedarm’s picture

Status: Active » Needs review
StatusFileSize
new1002 bytes

The array merging logic for "Set the correct node field values." looks wrong. It's trying to do:

array(0 => array('url' => 'value')) + array(0 => array('title' => 'value'))

and should probably be doing:

array(0 =>
array('url' => 'value') + array('title' => 'value')
)

Attached patch fixes the Link field bug, but it's so generic there's probably other things affected by this bug and fix.

Also the "Unset the dummy column value." block looks like it should be inside of the columns foreach and accidentally got moved outside. Moved it back in and now it looks like dummy values are unset properly. I'm not very familiar with this code, so someone needs to check that this is how it's supposed to work.

frankcarey’s picture

Status: Needs review » Postponed (maintainer needs more info)

Any chance this is related your your issue? #678524: problem with CCK fields with more than one column

cedarm’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new623 bytes

Yup, it's a dup of #678524: problem with CCK fields with more than one column. Just didn't manage to find it before submitting this. I never knew one could write $node->{$field_name}[$delta].

So how about the second part to clean up the dummy column values? It's close, but this patch should apply to 1.0-alpha2 or HEAD.

frankcarey’s picture

Version: 6.x-1.0-alpha2 » 6.x-1.x-dev

Any patches should be applied against 1.x-dev (DRUPAL-6--1), not HEAD or the current alpha/beta. Assuming your patch still works as advertised, can someone give this a look and a test? thanks.

cedarm’s picture

FYI just checked and patch still applies to dev (offset 5 lines). And those 5 lines are due to the patch in #678524.

mikeryan’s picture

Status: Needs review » Closed (duplicate)

Migrate and Migrate Extras V1 are no longer supported. Link support for V2 is covered in #1010850: Update MigrateFieldHandler to work with migrate-7.x-2.4 and later.