I tried to export a very simple CCK node. Just a title and a text field, and one record.
export_test is the name of the cck field
text_1 is the name of the text field

I have Drupal 4.7.3 Installed with no other modules besides the basic install set, CCK and import-export

Here is the result:
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 'AS text1_value, .vid AS text1_vid, .nid AS text1_nid, u.name, u.mail, ff.name AS' at line 1 query: SELECT nr.nid, nr.vid, nr.uid, nr.title, nr.body, nr.teaser, nr.log, nr.timestamp, nr.format, .field_text1_value AS text1_value, .vid AS text1_vid, .nid AS text1_nid, u.name, u.mail, ff.name AS format_name FROM node_revisions nr LEFT JOIN node_content_export_test ON nr.vid = .vid LEFT JOIN users u ON nr.uid = u.uid LEFT JOIN filter_formats ff ON nr.format = ff.format in /srv/www/htdocs/ca/public_html/4.7.3/includes/database.mysql.inc on line 120.

CommentFileSizeAuthor
#2 node_type_table.patch.txt1.17 KBJacobSingh

Comments

owen barton’s picture

I can also reproduce this error - pasted below with an xdebug stack trace.

PHP 5.1.0
MySQL 5.0.22

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 'AS text_value, .vid AS text_vid, .nid AS text_nid, u.name, u.mail, ff.name AS fo' at line 1 query: SELECT nr.nid, nr.vid, nr.uid, nr.title, nr.body, nr.teaser, nr.log, nr.timestamp, nr.format, .field_text_value AS text_value, .vid AS text_vid, .nid AS text_nid, u.name, u.mail, ff.name AS format_name FROM node_revisions nr LEFT JOIN node_content_test_content_type_2 ON nr.vid = .vid LEFT JOIN users u ON nr.uid = u.uid LEFT JOIN filter_formats ff ON nr.format = ff.format in /.../drupal-4-7/includes/database.mysql.inc on line 120

Call Stack
#	Function	Location
1	{main}()	/home/owen/workspace/drupal-4-7/index.php:0
2	menu_execute_active_handler()	/home/owen/workspace/drupal-4-7/index.php:15
3	call_user_func_array ()	/home/owen/workspace/drupal-4-7/includes/menu.inc:418
4	importexportui_page()	/home/owen/workspace/drupal-4-7/includes/menu.inc:0
5	importexportui_mapping_form()	/home/owen/workspace/npc2/modules/contrib/importexportapi/ui/importexportui.module:85
6	drupal_get_form()	/home/owen/workspace/npc2/modules/contrib/importexportapi/ui/importexportui.module:221
7	drupal_submit_form()	/home/owen/workspace/drupal-4-7/includes/form.inc:127
8	call_user_func_array ()	/home/owen/workspace/drupal-4-7/includes/form.inc:200
9	importexportui_mapping_form_submit()	/home/owen/workspace/drupal-4-7/includes/form.inc:0
10	importexportui_do_export()	/home/owen/workspace/npc2/modules/contrib/importexportapi/ui/importexportui.module:296
11	importexportapi_get_data()	/home/owen/workspace/npc2/modules/contrib/importexportapi/ui/importexportui.module:310
12	importexportapi_db_get()	/home/owen/workspace/npc2/modules/contrib/importexportapi/importexportapi.module:677
13	db_query()	/home/owen/workspace/npc2/modules/contrib/importexportapi/engines/importexportapi_db_get.inc:125
14	_db_query()	/home/owen/workspace/drupal-4-7/includes/database.inc:197
15	trigger_error ()	/home/owen/workspace/drupal-4-7/includes/database.mysql.inc:120
JacobSingh’s picture

Assigned: Unassigned » JacobSingh
Status: Active » Needs review
StatusFileSize
new1.17 KB

Okay, There are actually two seperate issues here.

One is that as of the new cck update, node_type is now called node_type_content

The second is that the hook content_def_tables should be content_db_def_tables

These two fixes seem to make it work

Jaza’s picture

Component: Miscellaneous » Code
Status: Needs review » Fixed

Patch committed to HEAD. Thanks, Jacob and Grugnog. ;)

For some reason, the errors weren't showing up for me (maybe my error_reporting is set too low?). But anyway, before applying the patch, the export was running without outputting the node revisions, and after applying, it was running with the node revisions. So I reproduced the bug nonetheless.

I didn't expect them to change the name of the 'node_type' CCK table for the 4.7 branch. They only needed to change it for HEAD. But anyway, c'est la vie!

scroogie’s picture

I dont get a mysql error now, but the first row that gets exported is still empty (meaning that the column titles dont get printed).

Anonymous’s picture

Status: Fixed » Closed (fixed)