Additional conversions for email, checkbox, select, and value

furmans - April 28, 2007 - 00:35
Project:Flexinode to CCK Converter
Version:5.x-0.2
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work
Description

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);
       }

#1

starbow - May 5, 2007 - 03:04
Category:bug report» feature request

#2

liquidcms - August 18, 2007 - 21:29

Anyone tested these to see if they work?

I have tried importing select fields with no luck.

#3

liquidcms - August 18, 2007 - 21:33

although 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.

#4

liquidcms - August 18, 2007 - 21:54

ok, 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.

#5

liquidcms - August 18, 2007 - 22:51

ok, sorted it out... the issue was that the original flexi select list looked like:

Govt|LA|NAEPP|EHA|Other

and i set up new cck options as:

Govt
LA
NAEPP
EHA
Other

and i should actually have set it up as:

1|Govt
2|LA
3|NAEPP
4|EHA
5|Other

#6

anarcat - April 30, 2009 - 16:59
Status:active» needs work

Please 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.

 
 

Drupal is a registered trademark of Dries Buytaert.