Closed (fixed)
Project:
Drupal core
Version:
6.x-dev
Component:
node system
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Apr 2007 at 06:45 UTC
Updated:
3 Mar 2009 at 02:35 UTC
When you are creating a new revision, if you leave log field empty then MySQL5 gives error about log field and you cannot access that node again. We need to handle this like we do for new nodes.
| Comment | File | Size | Author |
|---|---|---|---|
| create_new_revision_mysql5.patch | 917 bytes | erdemkose |
Comments
Comment #1
dries commentedCan someone reproduce this?
Comment #2
Zen commentedCannot reproduce with PHP 5 & MySQL 5. Please make sure that you have a clean install of HEAD.
-K
Comment #3
erdemkose commentedI may be missing something so please take a look at the video.
http://erdemkose.com/files/drupal6revisionbug.htm
Comment #4
webchickUm. Wow. Yeah, I'd call that critical. ;)
Video shows a clean install using MySQLi from HEAD checked out of CVS. A page is created with two revisions, each with an empty log message (the "Create new revision" checkbox is checked manually for revision 2).
On the second revision, the error pops up:
And the page, which would normally be the node, says "Access denied." Upon clicking back to the home page, there's simply "n/a" and dozens of notices about there being undefined properties. Um. Oops. ;)
Using PHP 5.1.6, MySQL 5.0.26, Apache 2.0.59 on Win32.
Now, with that all said, I could not duplicate this on PHP 5.1.4, MySQL 5.0.19, and Apache 2.0.55 on Mac OS X (MAMP). :(
Comment #5
erdemkose commentedI think I should explicitly say that this is about SQL Mode of MySQL. My installation has Strict mode On, if your mysql server runs in normal mode then you won't get the same errors.
Please run "SELECT @@sql_mode" query on your mysql server and if it doesn't return one of the "TRADITIONAL, STRICT_TRANS_TABLES, or STRICT_ALL_TABLES" modes then it means strict mode is not enabled on your server.
I will quit assuming MySQL5 means MySQL Strict Mode. I am sorry for wasting your time. Can you retry with Strict mode On? If it cannot be reproduced again then I will search the reason in my mind :)
Comment #6
Zen commentedMaybe it's Windows specific?
The following works for me:
erdemkose, could you please test the above?
My specifics: Apache/2.0.55 (Ubuntu) DAV/2 SVN/1.3.2 PHP/5.1.6 + MySQL 5.0.24a.
Also, the code for D5 is pretty much the same. Could you please also try replicating this on D5?
As for the patch, if it is needed, it might be cleaner to just initialise the log field via the two arrays above the block of code in the patch in #1.
Cheers,
-K
Comment #7
Zen commentedCross-post.
Comment #8
Zen commentedThis appears to be a duplicate of http://drupal.org/node/100850 which seems to have partially fixed the issue.
-K
Comment #9
erdemkose commentedYeah, I know this bug exists in Drupal 5, too. It may exists in 4.7.x, but I thought that we should backport the fix.
I searched the active issues but not the closed ones. Yes, if it was active then mine would be a duplicate of it. Can you reproduce the bug in strict mode? Does the patch fix it?
Comment #10
erdemkose commentedfixed in http://drupal.org/node/100850
Comment #11
erdemkose commentedComment #12
kristen polI'm confused. The posts about this issue say that it is fixed with these patches. I see drupal 5 patches, but nothing for drupal 6. I see this problem on a wamp installation but not on my linux machine, but it appears that the linux mysql is not using strict and the wamp mysql is.
So, is the solution to this issue to *not* run strict? That doesn't seem like a good solution.
I just tried to modify my column to have a default value of '' and got this:
BLOB/TEXT column 'log' can't have a default value
So, either I can allow null or turn off strict or ???
Comment #13
damien tournoud commented@kepol: please see #261258: Fix node_save() insertion logic.
Comment #14
kristen polThanks! But, it appears to be a patch for drupal 6.4 (?). I just updated to 6.10. Will I need to replicate the changes? Why didn't this get into the drupal 6 after this issue has been floating around for years? I'll dig into it right now... thanks again.
....
I just started comparing the patch against 6.10 and some of the code is in there... perhaps all of it. It's hard to compare. Perhaps I will just turn off strict and not worry about it.
....
We turned of strict and it's fine. I'm too tired to figure out how to patch it.