Closed (fixed)
Project:
Event
Version:
4.6.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Nov 2005 at 22:44 UTC
Updated:
21 Jan 2006 at 13:36 UTC
Jump to comment: Most recent file
Comments
Comment #1
drewish commentedhttp://drupal.org/node/20869 has the same error message (make sure when you're searching for bugs that you check the closed and duplicates too). the bug was supposedly "fixed" it but as you noticed, it doesn't work.
http://drupal.org/node/31193 i wrote a patch for this a couple of weeks ago but it hasn't been committed yet, you could probably tweak it to apply to the 4_6 branch.
Comment #2
bigbman commentedI think the patch fixed it, thanks!
Comment #3
bigbman commentedI'm still getting this bug from the latest release.
Comment #4
drewish commentedyeah that last patch was for the HEAD version, I've attached a patch that backports the fix for this bug to 4.6. I'll warn you, I didn't fire up 4.6 to test this so it may not work. If you could post some feedback either way, that would be helpful.
Comment #5
bigbman commentedNope, still getting the error. I'd having to do the patches by hand since my windows patch program is throwing errors. Could you just post the module, or the function?
Comment #6
drewish commentedHere's the complete function:
Comment #7
bigbman commentedWell, I updated that function in my event.module, and am still getting the following errors at the top of my page:
warning: gmdate() [function.gmdate]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in C:\webapps\xampp\htdocs\drupal\includes\common.inc on line 888.
warning: gmdate() [function.gmdate]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in C:\webapps\xampp\htdocs\drupal\includes\common.inc on line 888.
warning: gmdate() [function.gmdate]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in C:\webapps\xampp\htdocs\drupal\includes\common.inc on line 888.
warning: gmdate() [function.gmdate]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in C:\webapps\xampp\htdocs\drupal\includes\common.inc on line 888.
warning: gmdate() [function.gmdate]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in C:\webapps\xampp\htdocs\drupal\includes\common.inc on line 888.
warning: gmdate() [function.gmdate]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in C:\webapps\xampp\htdocs\drupal\includes\common.inc on line 888.
warning: gmdate() [function.gmdate]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in C:\webapps\xampp\htdocs\drupal\includes\common.inc on line 888.
warning: gmdate() [function.gmdate]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in C:\webapps\xampp\htdocs\drupal\includes\common.inc on line 888.
warning: gmdate() [function.gmdate]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in C:\webapps\xampp\htdocs\drupal\includes\common.inc on line 888.
warning: gmdate() [function.gmdate]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in C:\webapps\xampp\htdocs\drupal\includes\common.inc on line 888.
Home
Comment #8
drewish commentedIt might be easier to do this debugging over IM. Drop me a message with a AIM, MSN, or Google Talk username or if you're interested.
Have you tried creating a new event and running the process? I'm curious if these warnings are coming from nodes that are already in the database and haven't been updated after the change.
Comment #9
drewish commentedOkay, that last patch was actually headed in the wrong direction.
The problem seems to be that when the node's even info is saved it's done with an UPDATE rather than a DELETE and INSERT. Normally this is more effecent but it doesn't work if there's no record in the event table, the changes will never be saved. This will happen if you create nodes, then enable tracking of event details for that node type. The event record wasn't created during the initial INSERT so the UPDATEs won't ever work.
This is a problem in both 4.6 and HEAD. I've attached a patch for 4.6, bigbman, would you mind giving it a try? Or, since you said your patch wasn't working, change lines starting at 1704 to:
Comment #10
drewish commentedComment #11
drewish commentedhere's the patch for HEAD. i expanded the comment a bit to make it clearer.
Comment #12
drewish commentedI should also mention that while I tested the 4.6 patch, I didn't try out the one for HEAD.
Comment #13
bigbman commentedThat patch didn't seem to change the initial problem at http://bhive.no-ip.org/node/add/event
I haven't tried adding an even yet because of this. Any ideas?
Comment #14
drewish commentedbigbman, i wasn't very clear, you'll need to get a clean copy of event.module and then paste in the changed lines.
if you want you can grab the latest copy from CVS.
Comment #15
diego_jarrin commenteddrewish, I have the same exact problem that bigbman has.
By "get a clean copy of event.module", did you mean get the CVS copy? I am using Drupal 4.6, not the CVS version. Is the CVS version of the event module compatible with Drupal 4.6 ?
Thank you,
Comment #16
drewish commenteddiego_jarrin, I recommended that bigbman get a clean copy because I'd had him make changes to his file. CVS contains copies for both 4.6 and the, unrelease, 4.7. The CVS link I posted was to the 4.6 branch.
If you haven't made any customizations you should be able to just make the changes listed in comment #9. If you have made changes you can just download a new copy of the event module and overwrite your old one or as I mentioned, grab a copy from CVS.
Hopefully that makes sense.
Comment #17
diego_jarrin commentedI have a clean event module, and I made the changes to the module as suggested in comment #9 above. However, the problem persists.
The problem occurs when I try to add any node type if I have allowed that node type to show in the event calendar (in admin/node/configure/types/blog). Here is the warning again:
warning: gmdate() [function.gmdate]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in E:\Websites\cms\drupal\includes\common.inc on line 888.
On the bright side, the events do get added to the events calendar, so it doesn't prevent the calendar from working. I'm thinking that if there is a way to prevent the warning itself from appear, we wouldn't necessarily have to fix the problem.
Any ideas?
Thanks for your help !!
Diego
Comment #18
diego_jarrin commentedIt seems this problem has been around for a VERY long time.
See http://drupal.org/node/1418
If you do a search in Google for "warning: gmdate() [function.gmdate]: Windows does not support dates prior to midnight (00:00:00)" you'll see that there are tons of Drupal websites that present very similar problems.
This seems like a pretty serious issue that probably affects not only the Event module but probably other modules as well. After all this time with this same problem I would imagine that someone would have come up with a solution or a replacement for gmdate?
Anybody?
Comment #19
hunmonk commentedthis is not fundamentally a drupal bug--it is poor windows handling of timestamps. from the php manual:
one way around this is to put in a check for a negative timestamp value anywhere format_date is called, and simply bypass the function. another good option would be to change your operating system ;)
Comment #20
drewish commenteddiego_jarrin, the warning is pretty generic, there's plenty of reasons you could get it. I think you'll keep seeing them until you update all the nodes with missing dates.
hunmonk, the problem isn't with Windows. The problem is that no timestamp is being loaded. When you add the timezone offset (which will be negative for timezones east of GMT) to zero, you'll get a negative time. It doesn't work any better on UNIX (1969 isn't much better than 1970 in this case) but you won't get the warning.
Comment #21
drewish commentedOkay, so after working with bigbman via IM, I present the following patch. It works for him so I hope it works for all the other 4.6 users.
The previous patch for HEAD (on comment #9) is still correct.
Comment #22
bigbman commentedMANY thanks to drewish. His fix did it for me!!!
Comment #23
killes@www.drop.org commentedJust a note that I won't accept any OS specific patches.
Comment #24
killes@www.drop.org commentedAh, ok, the patch isn't OS specific. I don't understand the comment, though. in fact it doesn't make any sense to me.
Comment #25
bigbman commentedAm I the only idiot trying to run my server on Windows? Seems there's a lot of modules out there that have WIndows specific bugs. Anyways, I'd hate to see drewish's work thrown out the window. Can we please take a look at this, or at least address the issue for this module?
Comment #26
drewish commentedKilles, Glad you looked at the prior comments and code before posting ;)
I'm not sure what's unclear about the comment... How about:
Comment #27
gerhard killesreiter commentedNow I got it. So this explanation is better.
And yes, I don't care about windows.
Comment #28
drewish commentedbigbman, don't mind Killes, he's always a little bit crabby. I wouldn't say idiot, perhaps just brave ;) But seriously, Drupal should work on Windows. I do all my development on Windows machines and host on UNIX. Please keep reporting the bugs that you find. You're saving the next person the trouble.
Comment #29
diego_jarrin commentedDrewish, thanks for the hard work. In my case, I've decided not to apply the patch because I seem to have gotten rid of this problem by upgrading to PHP 5.1.1. I decided to give it a try because one of the improvements of 5.1.1 (implemented in 5.1.0 actually) is:
"- A complete rewrite of date handling code, with improved timezone support. "
And the rewrite seems to have worked very nicely. I'm not getting this warning anymore. I don't think I changed any of my settings, but of course I could be wrong.
Just for kicks, I reverted to the original event.module included in 4.6 and it's working just fine, so I decided to leave it as it was.
Thank you anyways for your hard work Drewish, it's very much appreciated.
Bigbman, you are not the only one trying to run Drupal on a windows system. There are plenty of us. And we are not idiots, in my case I just have to work within the constraints of my clients.
There is no reason why Drupal cannot work with windows (other than Gerhard not caring about windows, of course). I for one will try to be more active on the development side, if not doing actual development yet, at least reporting any bugs that I find in Windows.
Comment #30
bigbman commentedHey, I'm baaaaaack!!!
I've got another error:
warning: gmdate() [function.gmdate]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in C:\webapps\xampp\htdocs\drupal\modules\event\event.module on line 1250.
warning: gmdate() [function.gmdate]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in C:\webapps\xampp\htdocs\drupal\modules\event\event.module on line 1250.
warning: gmdate() [function.gmdate]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in C:\webapps\xampp\htdocs\drupal\modules\event\event.module on line 1250.
warning: gmdate() [function.gmdate]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in C:\webapps\xampp\htdocs\drupal\modules\event\event.module on line 1250.
warning: gmdate() [function.gmdate]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in C:\webapps\xampp\htdocs\drupal\modules\event\event.module on line 1250.
warning: gmdate() [function.gmdate]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in C:\webapps\xampp\htdocs\drupal\modules\event\event.module on line 1250.
warning: gmdate() [function.gmdate]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in C:\webapps\xampp\htdocs\drupal\modules\event\event.module on line 928.
warning: gmdate() [function.gmdate]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in C:\webapps\xampp\htdocs\drupal\modules\event\event.module on line 1250.
warning: gmdate() [function.gmdate]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in C:\webapps\xampp\htdocs\drupal\modules\event\event.module on line 1250.
warning: gmdate() [function.gmdate]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in C:\webapps\xampp\htdocs\drupal\modules\event\event.module on line 1250.
warning: gmdate() [function.gmdate]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in C:\webapps\xampp\htdocs\drupal\modules\event\event.module on line 1250.
warning: gmdate() [function.gmdate]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in C:\webapps\xampp\htdocs\drupal\modules\event\event.module on line 1250.
warning: gmdate() [function.gmdate]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in C:\webapps\xampp\htdocs\drupal\modules\event\event.module on line 1250.
warning: gmdate() [function.gmdate]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in C:\webapps\xampp\htdocs\drupal\modules\event\event.module on line 928.
warning: gmdate() [function.gmdate]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in C:\webapps\xampp\htdocs\drupal\modules\event\event.module on line 1250.
and so on...
The admin error shows:
gmdate() [function.gmdate]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in C:\webapps\xampp\htdocs\drupal\modules\event\event.module on line 928.
Comment #31
drewish commenteddiego_jarrin, I'm pretty sure all that the upgrade to 5.1.1 did was remove the warning message. The bug is and was in the event.module, you're just not seeing the warning related to it.
Comment #32
drewish commentedbigbman, what page are you looking at to get all those warnings?
Comment #33
bigbman commentedThat error is showing up on my start page, so my guess is that it's one of the event blocks. I definitely think it's something on line 928:
gmdate() [function.gmdate]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in C:\webapps\xampp\htdocs\drupal\modules\event\event.module on line 928.
Comment #34
diego_jarrin commentedHmmm... Drewish, but the Event module seems to be working very well as far as I can tell. I've scheduled several events and they all appear to be ok.
Are you sure PHP 5.1.1. only got rid of the warning? It does say in the PHP website that it was a complete rewrite of the date functions...
Comment #35
drewish commenteddiego_jarrin, well there are a few bugs mixed in together here. the big one is easy to reproduce:
* disable the event module
* create a node that is event enabled
* re-enable the event module
* try to set a date on the node created when the event module was disabled
the other bug is that the event_start and event_end variables aren't being correctly initialized by event_validate_form_date(). it's the one causing all the 1970 warnings. perhaps as part of the upgrade they've implemented support for negative timestamps on windows, i'm not really sure. either way the bug is still there.
i'm not sure what bigbman's latest bug is about, i'll have to have him insert some debug code for me to track it down.
attached is an 4.6 patch with the new comments and another correction to event_validate_form_date().
Comment #36
drewish commentedpatch with updated comment for HEAD.
Comment #37
bigbman commentedI'm more than willing to open ftp access to anyone willing to helpe me debug this problem on my windows machine.
Comment #38
drewish commentedbigbman, grab a clean copy of event.module then apply the latest 4.6 patch. let me know how that works.
Comment #39
bigbman commentedI'd appreciate it if someone could provide me with a patched version of the module. Cygwin for windows just isn't working well with Unix format files.
Comment #40
drewish commenteddude, install a copy of the cygutils/cygutils package. it's got two program called unix2dos and dos2unix to switch line endings.
Comment #41
bigbman commentedOK, I'm downloading that now. Where's the best place to get a tarball of the latest branch? I'm looking here:
http://cvs.drupal.org/viewcvs/drupal/contributions/modules/event/?only_w...
Is this the right place for 4.6 (it seems to have the latest event.module)?
Seems I have to download each file 1 by 1. Any way around this?
Also, you want me to use the above 4.6 patch, right?
Comment #42
bigbman commentedI'm sorry, but even after converting both the module and the patch, I'm getting rejects from the patch (see attached). I wish I didn't have to impose these problems on you guys. I'll try to figure out the patch thing on my own, but in the meantime, and help would be much appreciated.
Comment #43
bigbman commentedOK, I ran a manual patch (by hand) of my event.module, and it didn't seem to fix the immediate error(s) on my start page. Attached is the module for reference.
Comment #44
jasoncd commentedThis may not be what you were looking for, but I've followed the suggestions here, and it's been running fine for a few months now:
http://drupal.org/node/8212
Comment #45
bigbman commentedThanks for the suggestions, but I'm not sure I want to muck with the Drupal code. Anyone have any other suggestions? Anyone willing to help me find a fix\workaround with the event.module?
Comment #46
drewish commentedbigbman, i don't want to waste time on this thread troubleshooting your bug. you need to enable the contact form on your profile page so i can contact you.
Comment #47
killes@www.drop.org commentedthanks, applied.
Comment #48
(not verified) commentedComment #49
Elkerton commentedThe original post cited the timestamp issue in common.inc. I encountered the same error when deleting a user who had submitted nodes. The inability to resolve the missing user assigned ID number caused the error. I fixed the problem by creating a user and manually changing the assigned ID number in MySQL to the original deleted value (I determined the missing ID number by looking in the node table and finding the offending nodes). Not programatically aesthetic but it worked.