Every time I use a profile I get this error. When I select the profile and then fill in the db info it always returns me to the select the profile page and I just select it again. And this is what it gives me but then the site works.
user warning: Duplicate entry 'page' for key 1 query: INSERT INTO khayavnode_type (type, name, module, description, help, has_title, title_label, has_body, body_label, min_word_count, custom, modified, locked, orig_type) VALUES ('page', 'Page', 'node', 'If you want to add a static page, like a contact page or an about page, use a page.', '', '1', 'Title', '1', 'Body', '0', '1', '1', '0', 'page') in /home/litebulb/public_html/drupal/includes/database.mysql.inc on line 172.
Comments
Comment #1
ench0 commentedIt's true the site works but it is missing all of the default node content types aside from the page. Opening the generated .profile file one can see that in the
* NODE TYPES *
section there is two INSERT queries for 'page' and nothing for the other types.
Looking inside profile_generator.module the query is constructed around line 190:
So for some reason the above does not correctly pick up the two content types enabled by default (Page and Story, both have custom=1).
I tried adding these lines just before the while:
The above outputs 1 into the logs (which is BS as going to phpMyAdmin and executing the same query on the node_type table returns 2).
Not sure what's going on here as this is as far as I got and now I gotta run... :)
Comment #2
ench0 commentedA fix for this problem is to re-initialize the $params array before every foreach ($fields as $field) loop:
There's also one more small correction in the above code - note the ."\n"; added at the end of the
This will add a missing newline char so the generated file is properly formatted.
I guess I should educate myself on how to create a patch file... one of these days... :) damn day job...
Comment #3
autopoietic commentedIt is really easy to create a patch, there is a handbook page that spells it all out:
http://drupal.org/patch/create
If you are using CVS version control, use your CVS client to create the patch - if not (as I assume you are not), download and install Diff (if you are on windows) from:
http://gnuwin32.sourceforge.net/packages/diffutils.htm
to make the patch it might be initially easiest to drop the file you are patching directly into C:\Program Files\GnuWin32\bin and run diff on it from 'next-door'
Comment #4
Shiny commentedThanks for your bug report - yes that bug had been fixed int he D6 version but missed in D5. Now in CVS and will be in next release