Error in Moving to PHP 5.3.0


(Keith Brown) #1

Hi Folks,


I was moving our install from a server runninf php 5.1.2 to one running 5.3 and I'm getting the following error:


    *PHP Error*
    File : [SYSTEM_ROOT]/packages/calendar/calendar_events/calendar_event_multi_date/calendar_event_multi_date.inc
    Line : 189
    Version : 4.6.0
    DB Type : pgsql
    
    Object of class Calendar_Event_Multi_Date could not be converted to string


So I was thinking I must have missed something in the server build but the only remotely strange thing I get when I run the check_requirements.php script is this:

    PHP Warning:  date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/London' for 'BST/1.0/DST'


Has anyone seen this before / got ideas on how to fix?

K

(Kbaker) #2

Hi kjb,


This is a bug which shouldn't cause many issues bar probably returning an uncached calendar event. You can view the bug here - http://bugs.matrix.squiz.net/view_bug.php?bug_id=5770



This fix is quite simple, just modify one line in your code


    
    --- packages/calendar/calendar_events/calendar_event_multi_date/calendar_event_multi_date.inc	2 Mar 2010 23:16:37 -0000	1.16
    +++ packages/calendar/calendar_events/calendar_event_multi_date/calendar_event_multi_date.inc	24 Jul 2012 18:54:08 -0000
    @@ -186,7 +186,7 @@
     		}
     
     		$cm = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('cache_manager');
    -		$cached_contents = $cm->loadFromCache($this, $cache_key);
    +		$cached_contents = $cm->loadFromCache($this->id, $cache_key);
     
     		// if the cache is empty, go ahead and regenrate a new version
     		if ($cached_contents === FALSE) {

(Keith Brown) #3

[quote]
Hi kjb,



This is a bug which shouldn't cause many issues bar probably returning an uncached calendar event. You can view the bug here - http://bugs.matrix.squiz.net/view_bug.php?bug_id=5770



This fix is quite simple, just modify one line in your code


    
    --- packages/calendar/calendar_events/calendar_event_multi_date/calendar_event_multi_date.inc	2 Mar 2010 23:16:37 -0000	1.16
    +++ packages/calendar/calendar_events/calendar_event_multi_date/calendar_event_multi_date.inc	24 Jul 2012 18:54:08 -0000
    @@ -186,7 +186,7 @@
     		}
     
     		$cm = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('cache_manager');
    -		$cached_contents = $cm->loadFromCache($this, $cache_key);
    +		$cached_contents = $cm->loadFromCache($this->id, $cache_key);
     
     		// if the cache is empty, go ahead and regenrate a new version
     		if ($cached_contents === FALSE) {

[/quote]



Great thanks :slight_smile: In fact it presented by printint out %asset_contents% and stopped the page rendering.



K