I've recently upgraded a site to PHP 5.4 and I'm now getting the following error upon viewing the calendar page:

Creating default object from empty value in .../modules/event/event.module on line 567.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jackalope’s picture

The attached patch fixes the problem for me; it's only an error that I started seeing when the server started running PHP 5.4.

cs_shadow’s picture

Status: Active » Needs review
FileSize
526 bytes

The patch in #1 fixes the issue though it was not correctly formatted. Attaching a properly formatted version of #1.

pwolanin’s picture

The $node object may be used earlier in the function for hook invocations, so it should be created higher up in the function I think.

pwolanin’s picture

Title: PHP error: Creating default object from empty value in .../modules/event/event.module on line 567. » PHP error: Creating default object from empty value in event.module on line 567.
Status: Needs review » Reviewed & tested by the community
FileSize
418 bytes

I think this is a slightly better fix - solves the error message for me, and creates $node above where it may be used in a hook

killes@www.drop.org’s picture

Status: Reviewed & tested by the community » Fixed

committed the last patch, thanks.

Status: Fixed » Closed (fixed)

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