When you have a content type with no Body field, and you edit/save an existing node of that type, you get an error message about a Duplicate INSERT.

Repeat by:
Create a new content type with no body (Body field label is blank).
Create a node of the new content type and save.
Edit/save the node a second time.
Error message:
user warning: Duplicate entry '1' for key 1 query: INSERT INTO remember_filter (uid, format) VALUES ('1', '0') in modules/remember_filter/remember_filter.module on line 39.

Comments

jromine’s picture

Title: Error on content type with no 'Body' » Duplicate SQL error on content type with no 'Body'
enjoy777’s picture

Any solution for this issue?

fastballweb’s picture

I think the "no Body" thing is a red herring ... I don't see anything in the extremely brief module code where it would seem to matter whether the node has a body. Plus, I've experienced this same issue on nodes that do have a body.

I've no idea how to write a patch, but I think the problem is on line 35:

if (db_result(db_query("SELECT format FROM {remember_filter} WHERE uid = '%d'", $user->uid))) {

Since the db records can be zero (perhaps if the user doesn't have a setting yet?), this condition can return false even if the user does have a record. It should be:

if (db_result(db_query("SELECT format FROM {remember_filter} WHERE uid = '%d'", $user->uid)) !== false) {

I have not tested this at all--it's been difficult for me to reproduce the bug in the first place.

enjoy777’s picture

hi fastballweb

Thanks for your assistance :)

I have not tested this at all--it's been difficult for me to reproduce the bug in the first place.

I have got this error when I created new content type and in the submission form settings in the field 'Body field label' I erase the word Body. After saving I have got a node without body. So I use it to create video nodes with links from youtube as well. Try this and I think you will see this error.
Hope this help make patch for this issue.