Unable to call MapsDisplayMap::initialize()
From Extension talk:Maps
Trying to install Maps on PHP 5.2.0 gives the following error:
Warning: call_user_func(MapsDisplayMap::initialize) [function.call-user-func]: Unable to call MapsDisplayMap::initialize() in .../extensions/Maps/Features/Maps_ParserFunctions.php on line 38 Warning: call_user_func(MapsDisplayPoint::initialize) [function.call-user-func]: Unable to call MapsDisplayPoint::initialize() in .../extensions/Maps/Features/Maps_ParserFunctions.php on line 38
This is due to the lines 37-39 (in 0.6 rc3, r67115):
foreach ( $egMapsFeatures['pf'] as $hook ) {
call_user_func( $hook );
}
which will result in calls like call_user_func('MapsDisplayPoint::initialize') which is a format supported by PHP 5.2.3+ only (as opposed to call_user_func(array('MapsDisplayPoint', 'initialize')) which works in PHP 5.*).
Quick workaround:
foreach ( $egMapsFeatures['pf'] as $hook ) {
if ( strpos( $hook, '::' ) !== false ) {
$hook = explode( '::', $hook );
}
call_user_func( $hook );
}
Tgr