Unable to call MapsDisplayMap::initialize()

Jump to: navigation, search

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 );
                }
Tgr07:34, 31 May 2010

Thanks for that! Just in time to have it in 0.6 :)

Jeroen De Dauw14:46, 31 May 2010
 
Personal tools

Variants
Actions
Navigation
Support
Download
Development
Communication
Toolbox