Couple of issues with the install_contact_add_category function:

1. The call to db_next_id seems to be producing duplicate keys
2. The insert query uses an invalid syntax.

After editing the function I end up with:

function install_contact_add_category($category, $recipients, $reply = '', $weight = 0, $selected = 0) {
  db_query("INSERT INTO {contact} (category, recipients, reply, weight, selected) VALUES ('%s', '%s', '%s', %d, %d)", $category, $recipients, $reply, $weight, $selected);
}

Everything seems to work as expected that way. I am using mysql 5.

Comments

boris mann’s picture

Assigned: Unassigned » boris mann

OK, thanks. I'll be checking in an update. Not sure what happened there.

sime’s picture

Component: Code » crud.inc
Status: Active » Fixed

Making the fix, since the same solution appears in this patch
http://drupal.org/node/170935#comment-598385

http://drupal.org/cvs?commit=90827

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.