Jump to:
| Project: | Drupal core |
| Version: | 7.x-dev |
| Component: | node.module |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed (duplicate) |
Issue Summary
0. Start with a fresh installation of drupal 6.2
1. Enable polls module
2. Create a poll with any two options e.g. Option 1: Yes Option 2: No
3. Check that the poll appears properly
4. edit the poll. Now add the third option
5. In the revision information click on the "Create a new revision" checkbox
6. Click on save
You should get an error which is something like this
-------------
user warning: Field 'body' doesn't have a default value query: INSERT INTO tst_node_revisions (nid, uid, title, teaser, log, timestamp, format) VALUES (1, 1, 'Abc', '* def\n* ghi\n* hji\n', '', 1211214598, 0) in C:\Apache\htdocs\error\includes\common.inc on line 3303.
Poll Abc has been updated.
The requested page could not be found.
-------------------
Now the frontpage gets corrupted with the poll no longer being displayed and only a red bar is there.
***Now try to create a poll, a page ANYTHING***
You get the following errors:
---------------
* user warning: Duplicate entry '0' for key 2 query: INSERT INTO tst_node (vid, type, language, title, uid, status, created, changed, comment, promote, moderate, sticky, tnid, translate) VALUES (0, 'page', '', 'dfdfasdf', 1, 1, 1211215341, 1211215341, 0, 0, 0, 0, 0, 0) in C:\Apache\htdocs\error\includes\common.inc on line 3303.
* user warning: Duplicate entry '0' for key 1 query: INSERT INTO tst_node_comment_statistics (nid, last_comment_timestamp, last_comment_name, last_comment_uid, comment_count) VALUES (0, 1211215341, NULL, 1, 0) in C:\Apache\htdocs\error\modules\comment\comment.module on line 607.
* The post could not be saved.
---------------
Thanks,
Sidharth
Comments
#1
third option can be anything e.g. "Don't Know/Cant say"
#2
#3
I can reproduce the fact that there is no body field (which is a bug by itself).
However, I cannot reproduce the error message on MySQL, which is traditionally quite lenient about these things. Could you give us more details about your MySQL configuration?
This is also in the 7.x branch, and is in fact a bug in
node_save(), so I reassign this issue to the correct queue.#4
Its a standard MySql configuration: 5.0.51b-community-nt MySQL Community Edition (GPL) (currently available for download at mysql.com)
Actually even if you are not able to replicate the error message... I hope you are able to see the "red" area when you go to the site home page to list the poll. Going to the previously created poll will give you a page not found error.
By assigning it to the 7.x queue will a fix still be generated for 6.x?
#5
afaik Poll is supposed to have no body field. I can't reproduce the error message either.
@sidharth_k: if the code hasn't changed to much, fixes are usually done in the development branch then backported to Drupal 6 - this keeps things consistent between versions as much as possible/necessary.
#6
@catch: I *CAN* reproduce that bug (the body is not there in the INSERT clause, but it has to be because the body field has no default).
What I can't reproduce is the error message from MySQL (mine does accept the query and put an empty string in the body field). Testing on PostgreSQL shows that Postgres does reject the query and exibit similar bugs as described by sidharth_k.
This bug is due to faulty insertion logic in
node_save(). Because it also causes problem elsewhere (notably in the book module, that is completely broken on PostgreSQL), I opened a separate issue with a patch proposal (#261258: Fix node_save() insertion logic).#7
That makes sense. Since this issue is about node_save rather than poll specifically, I'll mark it as a duplicate of http://drupal.org/node/261258