On a site, I had all the CCK modules enabled, BUT content_copy.module. I had already created a few content types. I went back to enable that last module, but upon submit, I had plenty of errors like this one:
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 'group ( vid int unsigned NOT NULL default '0', query: CREATE TABLE content_type_organic group ( vid int unsigned NOT NULL default '0', nid int unsigned NOT NULL default '0', PRIMARY KEY (vid) ) /*!40100 DEFAULT CHARACTER SET utf8 */ in includes/database.mysql.inc on line 172.
Note in the query: CREATE TABLE content_type_organic group: It uses "organic group" instead of "organic_group", i.e. the script uses the node type's human name, instead of its machine name.
I tested on a fresh install of a site. On a fresh install, only 'story' and 'page' exist. I enabled all the cck modules and got a similar problem:
The content fields table node_Page has been created.
The content fields table node_Story has been created.
Note the capitalization: node_Story instead of node_story. The difference is that, because there is only one word, there aren't any space and the query was successfully executed.
Comments
Comment #1
karens commentedI think I found the problem and fixed it. I'll keep testing to be sure, but reopen if latest cvs still creates the same problem.
Comment #2
beginner commentedThanks.
I have a question, though:
on my previous test on a clean install, I had the messages:
""The content fields table node_Page has been created.
The content fields table node_Story has been created.""
Now, on a new clean install (with the latest fixes in), I get nothing upon enabling the CCK modules.
Is the module supposed to create the content_type_page, content_type_story tables? And for other node types defined by other modules? (forum, blog, etc.)
Also, a request:
Can the developers test the code on sites/DB where you use table prefixes? ;)
This way you may avoid a similar mess in the future.
Comment #3
karens commentedYes, obviously we should have been testing the code with prefixes and will do so in the future (or at least try to).
You should be getting messages and tables should be created, nothing was changed about that. I'll dig into that.
Comment #4
karens commentedThey are created if you go back and actually submit the modules page again, just not from the system update. This seems to be fixed by fix in http://drupal.org/node/112225 that moves our table building code to hook_enable.
Comment #5
beginner commentedok. Tested again on another fresh install: it works the first time, now.
May I suggest something else? :)
Can you post a link to the cvs commits in a follow up, so that others may follow the exact changes?
http://drupal.org/cvs?commit=53211
http://drupal.org/cvs?commit=53212
Anyway, you guys rock! The response is very rapid!
Cheers.
Comment #6
(not verified) commented