Closed (won't fix)
Project:
Migrate Extras
Version:
master
Component:
CCK
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
8 Oct 2009 at 14:19 UTC
Updated:
23 Jun 2011 at 23:10 UTC
Jump to comment: Most recent file
Comments
Comment #1
moshe weitzman commentedeaton mentioned in IRC that he would work on this a little more. i think the line
$value = intval($value);has to be removed. otherwise, this patch looks good to me.
Comment #2
eaton commentedActually after taking a second look at it, I think the patch should be okay. The context for those changes is:
What this means is that
$value=intval($value);will only ever be called if the value should, in fact, be an int. That line was there before this patch, and shouldn't cause any problems. We just add an extra case to see whether the resulting integer is also mapped to a new key value.Comment #3
moshe weitzman commentedI should elaborate. The problem with this code as I see it is that if you get a miss for some reason in _migrate_xlat_get_new_id(), you still get a node ref recorded for an id that is presumed to be a node. Thats kinda chaotic behavior, IMO. I think there should be no node reference in this case. thats why i suggested to remove: $value = intval($value);.
Comment #4
mikeryanI think a better approach would be to allow mapping explicitly by old ID, Drupal nid/uid, or title/username. See as an example the comment support for migrating authors.
Comment #5
mikeryanCCK support has been moved to the migrate_extras module.
Comment #6
stella commentedHere's a patch re-roll against the 'migrate extras' module.
I agree with @mikeryan, that longer term, a better approach might be something like that of the 'node authoring' fields, just wasn't quite sure how best to approach it within the current structure.
Comment #7
stella commentedComment #8
thekenshow commentedI applied and tested this patch on 6.x-1.0-beta1 and ran into an issue because my referenced node titles begin with digits. This causes intval($value) to convert the title to an integer by truncating after the opening digits (e.g., "89584333-c1ea-4f7d-a819-e13e05baa2ae" becomes the integer 89584333) and then assigning that as a nid. I played with combining an is_string() check, but that errs in the other direction ("89584333" is identified as a string). So for the time being, perhaps add a warning that imported titles cannot begin with a digit or they'll be converted to int and evaluated as nid.
Comment #9
mikeryanMigrate and Migrate Extras V1 are no longer supported. Migrate V2 natively supports mapping referenced IDs.