After upgrading to php 5.3 I started getting lots of errors like this:

Warning: Attempt to modify property of non-object in [site path]/modules/calendar/includes/calendar_plugin_display_page.inc

Warning: Attempt to modify property of non-object in [site path]/modules/calendar/includes/calendar_plugin_display_block.inc

Warning: Attempt to modify property of non-object in [site path]/modules/calendar/includes/calendar_plugin_display_attachment.inc

Based on a workaround for a related issue with Date (http://drupal.org/node/549884#comment-2067884) I have produced a patch file which simply wraps the offending code with this:

if (is_object($display)){
.....
}

This gets rid of the error messages, but doesn't address the real problem, which is why the code is trying to treat an array like an object. Simply deleting the offending lines may well have achieved the same thing but I don't know enough about the module to be sure

CommentFileSizeAuthor
calendar-6.x-2.x-dev.patch4.29 KBdrasgardian
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pyctures’s picture

Hello,
I also have this problem.
Did you find another solution ?
Is it better to use PHP 5.2 ?
Thanks

drasgardian’s picture

The patch has worked fine for me so far.

pyctures’s picture

The patch also works for me...

arlinsandbulte’s picture

Status: Active » Closed (duplicate)

Duplicate of #613528: PHP 5.3 issue - Attempt to modify property of non-object (Calendar Module)
There is a patch and more discussion over there.

I will post a comment over there about the patch here, that may be helpful over there.