This may be the same issue as #463052: warning: date_timezone_set() expects parameter 1 to be DateTime, null given but I'm getting the error on different code lines (which may or may not be because I'm using the latest devs). I thought it safer to open a new issue.

  • PHP 5.2.6
  • Drupal 6.13
  • CCK 6.x-2.x-dev July 21
  • Date 6.x-2.x-dev June 21
  • Mollom 6.x-1.9

On a fresh Drupal install, enable CCK and Date. Add a datetime field to the story content type, keep the field defaults. Submit a story as an authenticated user, it works perfectly.

Enable Mollom and set the story form to "Text analysis and CAPTCHA backup". Try to submit a story form, you'll get this warning:

warning: date_format() expects parameter 1 to be DateTime, null given in /var/www/vhosts/keeptrust.org/httpdocs/sites/all/modules/date/date/date.module on line 356.
warning: date_timezone_set() expects parameter 1 to be DateTime, null given in /var/www/vhosts/keeptrust.org/httpdocs/sites/all/modules/date/date/date.module on line 358.
warning: date_format() expects parameter 1 to be DateTime, null given in /var/www/vhosts/keeptrust.org/httpdocs/sites/all/modules/date/date/date.module on line 360.
warning: date_offset_get() expects parameter 1 to be DateTime, null given in /var/www/vhosts/keeptrust.org/httpdocs/sites/all/modules/date/date/date.module on line 362.

The node is created correctly.

Setting the form to "CAPTCHA only" makes the warning disappear.

Comments

Axol00’s picture

Greeting I have the same issue,

But in my case is when I tried to create a New Event, and when I clicked on Preview or Save I have the same warnings in date.module like above.

I tried to solve but only two things help me with this warnings:
One, I deactivate The mollom module, obviously, my event was created perfectly.
And two, Setting In Mollom settings on Protected Event Form with "No Protection".

Any help with this bug on Mollom??

Thanks!!

eft’s picture

I am also seeing same behaviour.

dave reid’s picture

Version: 6.x-1.9 » 6.x-1.x-dev
Assigned: Unassigned » dave reid

Alright I think I saw this once on my local install. I'll try and do a little more debugging about this.

mikemccaffrey’s picture

We're seeing this on our site as well. We were assuming that it was a bug in the Date module, as thing start to go wrong in the date_formatter_process function. It took us a while to track it down to Mollom reviewing the field.

dries’s picture

I looked into this but I don't think it's a Mollom bug. It seems a bug outside of Mollom triggered by Mollom.

dries’s picture

This will be fixed in the upcoming version of Mollom. We no longer use node_rebuild().

dries’s picture

Status: Active » Fixed
ljesposito’s picture

So is the best workaround to disable Mollum until the fix is released? And is there an ETA?

Thanks,
Larry Esposito (newbie)

Status: Fixed » Closed (fixed)

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