Got a WSOD and the above fatal error when saving a node.

Apparently there have been some changes in Date API.

Patch fixes the problem for me.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Mark Trapp’s picture

Priority: Critical » Normal
Status: Needs review » Postponed (maintainer needs more info)

Just tested with Drupal core's latest HEAD and Date's latest HEAD and not seeing the problem. Additionally, all tests pass. There's no reason why DateObject::createFromFormat would stop working: DateObject extends DateTime.

So I have a few questions to see if we can resolve this:

  • Can you provide a test case reduction so your problem can be reproduced?
  • Can you point out the recent changes to Date API that you think are causing this problem?
  • If there's a problem with Date Popup Authored's tests such that they're passing when they shouldn't, can you reroll your patch to include the fixes to the tests?
pillarsdotnet’s picture

Component: Code » Documentation
Priority: Normal » Minor
Status: Postponed (maintainer needs more info) » Needs review
FileSize
302 bytes

You're right; it wasn't a Date API change. I didn't realize that createFromFormat was a DateTime method, so when I grepped for it and came up empty, I assumed that it wasn't supported anymore. Knee-jerk reaction from running bleeding-edge software.

(looking...)

Hmm... I've also been getting sporadic "Call to undefined function user_access()" so it may be an out-of-memory issue. Dunno.

You might want to mention in your REQUIREMENTS section that your module requires PHP 5.3.0 or later. I know it's recommended for Drupal 7, but it isn't required just yet.

Mark Trapp’s picture

Title: PHP Fatal error: Call to a member function format() on a non-object in date_popup_authored.module on line 121 » Make Date Popup Authored work in PHP 5.2
Component: Documentation » Code
Category: bug » feature
Priority: Minor » Major
Status: Needs review » Fixed

Ah, I didn't catch that DateTime::createFromFormat was PHP >= 5.3.0. That's reason enough for me to implement the change from your first patch: does the same thing, all tests pass, and PHP 5.2 support should be back. Patch in OP is committed.

Status: Fixed » Closed (fixed)

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