Download & Extend

"You have an error in your SQL syntax" and further questions

Project:Flexinode to CCK Converter
Version:4.7.x-0.2
Component:Documentation
Category:support request
Priority:critical
Assigned:JStarcher
Status:needs work

Issue Summary

Note: If you can help me get this working correctly I would be happy to clarify the installation documentation and do a longer "guide" to help others. I am sure there are a lot of people in the "I used Flexinode and now I am stuck on 4.7.x but I need to migrate to 5.x" boat -- so in this regards this module is awesome!

I have a site on 4.7.x that I used Flexinode to create a custom node for recipes. The flexinode has 11 fields, one is a graphic (example node: http://www.tammysrecipes.com/blueberry_orange_julius).

I attempting to migrate to Drupal 5.x, so I need to migrate my flexinode to CCK--so I am totally excited about this module! But I think I have encountered some ID10T user error on my part :| (Thankfully I am doing this on a backup test site)

I tried running the module and I got an error (see below). Can you tell from the error message what I did wrong? I tried to follow the steps in order...

1. Turn off flexinode => I disabled this in admin/modules

2. Turn on CCK & required CCK field modules => Enabled CCK and text field and also uploaded and installed the image CCK module and enabled it in admin/modules

3. Create new CCK type for each old type - each field must have the same name as the old field => I did this as careful as I could.

I ran into some questions, namely that once your create the field not all the CCK and Flexnode details overlap perfectly. e.g. CCK lacked the "show in table" and "show in teaser" elements that Flexinode has right under "required".

Likewise Flexinode has a description ("A brief description of the field, to be displayed on the content submission form.") and CCK a help attribute ("Instructions to present to the user below this field on the editing form."). I did NOT put my Flexinode "description" text into the CCK "help" field because I wasn't sure if they corresponded correctly.

Finally Flexinode's image field has a lot more settings like preview dimensions, thumbnail dimensions, max picture size.

4. Run admin/flexiconvert/convert for each node type, select the matching names in both selectors (Be sure not add categories to the CCK types until after you run the converter, because then cck restructures the node table). => Does this mean "categories" as in "fields"?

Are you saying NOT to fill out any of the info after you create the field name OR not to create any secondary new fields (e.g. baking time) until after you convert?

Good Luck! => :)

I am a little confused about a couple other things as well. I noticed there is a Drupal 5.x version and a Drupal 4.7.x version. Flexinode has no Drupal 5.x release to my knowledge, so why is there a 5.x version? Is it suggested to upgrade to 5.x and then run the converter? What are the advantages and disadvantages of such?

Syncing flexinode: flexinode-1 to cck: content_recipe
Mapping Recipe Name (flexifield-1) to field_recipe_name
Mapping Description (flexifield-2) to field_description
Mapping Yield (flexifield-3) to field_yield
Mapping Preparation Time (flexifield-15) to field_preparation_time
Mapping Picture (flexifield-17) to field_picture
Mapping Ingredients (flexifield-6) to field_ingredients
Mapping Instructions (flexifield-11) to field_instructions
Mapping Additional Notes (flexifield-12) to field_additional_notes
Mapping Tammy's Review (flexifield-9) to field_tammy's_review
Mapping Cooking Time (flexifield-16) to field_cooking_time
There are 310 items to convert
Inserted '0' items (310)
Boo!!
user warning: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'value ('23', '23')' at line 1 query: insert into node_content_recipe (nid, vid) value ('23', '23') in /home/newtam/public_html/includes/database.mysql.inc on line 121.
user warning: Unknown column 'field_description_format' in 'field list' query: UPDATE node_content_recipe SET field_description_format = '3' WHERE nid = 23 in /home/newtam/public_html/includes/database.mysql.inc on line 121.
user warning: Unknown column 'field_ingredients_format' in 'field list' query: UPDATE node_content_recipe SET field_ingredients_format = '3' WHERE nid = 23 in /home/newtam/public_html/includes/database.mysql.inc on line 121.
user warning: Unknown column 'field_instructions_format' in 'field list' query: UPDATE node_content_recipe SET field_instructions_format = '3' WHERE nid = 23 in /home/newtam/public_html/includes/database.mysql.inc on line 121.
user warning: Unknown column 'field_additional_notes_format' in 'field list' query: UPDATE node_content_recipe SET field_additional_notes_format = '3' WHERE nid = 23 in /home/newtam/public_html/includes/database.mysql.inc on line 121.
user warning: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '\'s_review_value = 'These waffles are so delicious!! I have nev query: UPDATE node_content_recipe SET field_tammy\'s_review_value = 'These waffles are so delicious!! I have never tasted a recipe that I like better. I even love to eat them plain, hot off the waffle iron! Sometimes I make extras and freeze to re-heat in the toaster later, but they really are best fresh. I would make these more often except that they are a little time-consuming to make and I'm usually in a hurry and reach for eggs instead. ;) My rating: 10/10' WHERE nid = 23 in /home/newtam/public_html/includes/database.mysql.inc on line 121.
user warning: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '\'s_review_format = '3' WHERE nid = 23' at line 1 query: UPDATE node_content_recipe SET field_tammy\'s_review_format = '3' WHERE nid = 23 in /home/newtam/public_html/includes/database.mysql.inc on line 121.

Finally, this is what I am trying to convert from Flexinode to CCK:

Flexinode Name: Recipe

Recipe Name [ required;
weight: -5

Picture [ description: Picture of food item;
max resolution: 800x600;
preview: 512x384;
thumbnail: 450x125;
max pic size 100;
show in teaser;
weight: -4

Description [ description: This is a short description AND in the teaser/excerpt.;
lines: 5;
required;
show in teaser;
show in table;
weight: -3

Yield  [ description:: How many servings?;
required;
weight: -3

Ingredients [ description: List of ingredients; 1 ingredient per line;
lines 8;
required;
weight: -2

Instructions [ description: Step by Step instructions;
lines: 5;
required;
weight: -1

Additional Notes [ description: Special notes, links to tips, etc;
lines: 5;
weight: 0

Preparation Time [ required
weight: 1

Cooking Time [ weight: 2

Tammy's Review [ lines 5;
weight: 4

Thanks for your time and assistance :)

Comments

#1

Assigned to:Anonymous» JStarcher
Status:active» needs review

I ran into some questions, namely that once your create the field not all the CCK and Flexnode details overlap perfectly. e.g. CCK lacked the "show in table" and "show in teaser" elements that Flexinode has right under "required".

If you use the Views module you can customize that stuff to your liking. Furthermore, the Contemplate module allows even more customization.

Likewise Flexinode has a description ("A brief description of the field, to be displayed on the content submission form.") and CCK a help attribute ("Instructions to present to the user below this field on the editing form."). I did NOT put my Flexinode "description" text into the CCK "help" field because I wasn't sure if they corresponded correctly.

You can put it in there, doesn't make any difference (from what I can tell).

Finally Flexinode's image field has a lot more settings like preview dimensions, thumbnail dimensions, max picture size.

If you use the image module it has all that stuff. You can use Imagecache as well. Pair those with Thickbox for a nice effect.

4. Run admin/flexiconvert/convert for each node type, select the matching names in both selectors (Be sure not add categories to the CCK types until after you run the converter, because then cck restructures the node table). => Does this mean "categories" as in "fields"?

Are you saying NOT to fill out any of the info after you create the field name OR not to create any secondary new fields (e.g. baking time) until after you convert?

I believe they are referring to taxonomy categories.

I am a little confused about a couple other things as well. I noticed there is a Drupal 5.x version and a Drupal 4.7.x version. Flexinode has no Drupal 5.x release to my knowledge, so why is there a 5.x version? Is it suggested to upgrade to 5.x and then run the converter? What are the advantages and disadvantages of such?

The only thing I can think of is if you upgrade to 5.x before converting to CCK. The data would still reside in the database so it wouldn't matter that there isn't a Flexinode for 5.x

Replace the flexiconvert.module file with the one I've attached. Let me know how it goes.

AttachmentSize
flexiconvert.module.tar_.gz 2.21 KB

#2

I have yet to get this to work. Please contact me if someone is interested in a bounty to convert my Flexinode data over to CCK. Getting the converter to work would be GREAT, but in the least I need my data ported to CCK.

#3

Status:needs review» needs work

Here's a proper patch rerolled against the 4.7 branch. While the patch does bring some bugfixes (apparently, not tested here) it blends up too much whitespace, cosmetic fixes with those bugfixes to be really useful anyways. So I'm marking this as needs work.

Besides, HEAD is now a full rewrite that seems like it doesn't load everything into memory and I encourage everyone to test that release instead (5.x-0.3).

AttachmentSize
166843_sqlerror_reroll.patch 11.11 KB