Hi all,

I'm using the menu and book modules and they seem to conflict. If I enable both and go to administer >> menus I get several sql errors:

user error: Duplicate entry '10' for key 1
query: INSERT INTO sp_menu (mid, pid, path, title, description, weight, type) VALUES (10, 20, 'node/add/book', 'book page', '', 0, 22) in /home/pocm/public_html/scheme_portal/includes/database.mysql.inc on line 66.

user error: Duplicate entry '11' for key 1
query: INSERT INTO sp_menu (mid, pid, path, title, description, weight, type) VALUES (11, 18, 'admin/node/book', 'books', '', 4, 22) in /home/pocm/public_html/scheme_portal/includes/database.mysql.inc on line 66.

user error: Duplicate entry '12' for key 1
query: INSERT INTO sp_menu (mid, pid, path, title, description, weight, type) VALUES (12, 11, 'admin/node/book/orphan', 'orphan pages', '', 8, 22) in /home/pocm/public_html/scheme_portal/includes/database.mysql.inc on line 66.

user error: Duplicate entry '13' for key 1
query: INSERT INTO sp_menu (mid, pid, path, title, description, weight, type) VALUES (13, 1, 'book', 'books', '', 0, 16) in /home/pocm/public_html/scheme_portal/includes/database.mysql.inc on line 66.

user error: Duplicate entry '14' for key 1
query: INSERT INTO sp_menu (mid, pid, path, title, description, weight, type) VALUES (14, 20, 'node/add/bookreview', 'book review', '', 0, 22) in /home/pocm/public_html/scheme_portal/includes/database.mysql.inc on line 66.

user error: Duplicate entry '15' for key 1
query: INSERT INTO sp_menu (mid, pid, path, title, description, weight, type) VALUES (15, 1, 'bookreview', 'book reviews', '', 0, 16) in /home/pocm/public_html/scheme_portal/includes/database.mysql.inc on line 66.

user error: Duplicate entry '16' for key 1
query: INSERT INTO sp_menu (mid, pid, path, title, description, weight, type) VALUES (16, 20, 'node/add/filestore2', 'upload file', '', 0, 22) in /home/pocm/public_html/scheme_portal/includes/database.mysql.inc on line 66.

user error: Duplicate entry '17' for key 1
query: INSERT INTO sp_menu (mid, pid, path, title, description, weight, type) VALUES (17, 31, 'admin/settings/bookreview', 'bookreview', '', 0, 22) in /home/pocm/public_html/scheme_portal/includes/database.mysql.inc on line 66.

user error: Duplicate entry '18' for key 1
query: INSERT INTO sp_menu (mid, pid, path, title, description, weight, type) VALUES (18, 31, 'admin/settings/filemanager', 'filemanager', '', 0, 22) in /home/pocm/public_html/scheme_portal/includes/database.mysql.inc on line 66.

user error: Duplicate entry '19' for key 1
query: INSERT INTO sp_menu (mid, pid, path, title, description, weight, type) VALUES (19, 31, 'admin/settings/filestore2', 'filestore2', '', 0, 22) in /home/pocm/public_html/scheme_portal/includes/database.mysql.inc on line 66.

Any ideas why?

Cheers,

Paulo Matos

Comments

harry slaughter’s picture

i'm not sure why this happens, but the sequences table doesn't reflect the number of items in your nodes table. this can happen if you import data into your DB, thereby circumventing the sequences in the drupal code.

you can fix this by checking the value of the relevant id (sp_menu.mid it looks like from above) and setting the corresponding sequence to a number greater than that.

SELECT max(mid) FROM menu;

that will return a number, say 123. now update the sequences table.

UPDATE sequences SET id = 124 WHERE name = 'menu_mid';

--
Living in fear of patch hell?
Want a stable development environment?
Support Dev Releases: http://drupal.org/node/30903
Support Code cleanup too: http://drupal.org/node/28540

--
Devbee - http://devbee.net/