Needs work
Project:
Flexinode to CCK Converter
Version:
5.x-0.2
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
28 Apr 2007 at 00:35 UTC
Updated:
30 Apr 2009 at 16:59 UTC
I had additional fields that I needed translated to CCK. BTW, thanks for a great module.
Here's the diff:
83a88,95
> else if ($row['field_type'] == 'email') {
> $nodes[ $row['nid'] ][$cckfield]['email'] = $row['textual_data'];
> }
> else if ($row['field_type'] == 'value'
> || $row['field_type'] == 'checkbox'
> || $row['field_type'] == 'select') {
> $nodes[ $row['nid'] ][$cckfield]['value'] = $row['numeric_data'];
> }
114a127,132
> else if ($value['email']) {
> db_query( "UPDATE {%s} SET %s = '%s' WHERE nid = %d", $cck_table, $cckfield . '_email', $value['email'], $nid);
> }
> else if ($value['value']) {
> db_query( "UPDATE {%s} SET %s = '%s' WHERE nid = %d", $cck_table, $cckfield . '_value', $value['value'], $nid);
> }
In English:
After line 83 add:
else if ($row['field_type'] == 'email') {
$nodes[ $row['nid'] ][$cckfield]['email'] = $row['textual_data'];
}
else if ($row['field_type'] == 'value'
|| $row['field_type'] == 'checkbox'
|| $row['field_type'] == 'select') {
$nodes[ $row['nid'] ][$cckfield]['value'] = $row['numeric_data'];
}
After line 114 add:
else if ($value['email']) {
db_query( "UPDATE {%s} SET %s = '%s' WHERE nid = %d", $cck_table, $cckfield . '_email', $value['email'], $nid);
}
else if ($value['value']) {
db_query( "UPDATE {%s} SET %s = '%s' WHERE nid = %d", $cck_table, $cckfield . '_value', $value['value'], $nid);
}
Comments
Comment #1
starbow commentedComment #2
liquidcms commentedAnyone tested these to see if they work?
I have tried importing select fields with no luck.
Comment #3
liquidcms commentedalthough i have tried changes to 4.7 version of flexiconvert not 5.02 as listed here.
Figured i would try converting flexi to cck before conversion to drupal 5 - but i guess i could do them in the other order.
Comment #4
liquidcms commentedok, well now that i have looked through the tables it does seem like the flexi data for my select lists has been converted to cck tables - but sadly the fields do not show when i look at the nodes that use these select lists.
Comment #5
liquidcms commentedok, sorted it out... the issue was that the original flexi select list looked like:
and i set up new cck options as:
and i should actually have set it up as:
Comment #6
anarcat commentedPlease roll a real patch. Also, 5.x has been rewritten, please test if those fields are imported properly in the 5.x-0.3 release.