BuddyPress Maps – Plugin could not be activated because it triggered a fatal error

After updating my BuddyPress on version 1.2.3 I was’t able to get working plugin BuddyPress Maps. Even when I use latest version 0.30 I got always error: “Plugin could not be activated because it triggered a fatal error.” -after activating plugin in admin interface. So how to rid of this error?

First step: – BuddyPress 1.2 uses different way for loading plugins than previous versions (You can read more about it here http://codex.buddypress.org/how-to-guides/checking-buddypress-is-active/). You have to modify your buddypress-maps.php something like this:

/*
Plugin Name: BuddyPress Maps
Plugin URI:  http://dev.benoitgreant.be/blog/category/buddypress/buddypress-maps/
Description: BuddyPress Maps is a component that allows to find and display location markers on a Google Map.  It includes several plugins to work with BuddyPress and its API has been coded to allow others plugins to use the component.
Version: 0.31
Revision Date: March 30 2010
Requires at least: WP 2.9.1, BuddyPress 1.2
Tested up to: WP 3.0-alpha, BuddyPress 1.2.2
License: (Maps: GNU General Public License 2.0 (GPL) http://www.gnu.org/licenses/gpl.html)
Author: G.Breant
Author URI: http://dev.benoitgreant.be
*/

function bp_maps_init() {

if ( ! defined( 'WP_CONTENT_DIR' ) )
define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );

if ( ! defined( 'WP_CONTENT_URL' ) )
define( 'WP_CONTENT_URL', get_option( 'siteurl' ) . '/wp-content' );

if ( ! defined( 'WP_PLUGIN_URL' ) )
define( 'WP_PLUGIN_URL', WP_CONTENT_URL. '/plugins' );

if ( ! defined( 'WP_PLUGIN_DIR' ) )
define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' );


require_once ( WP_PLUGIN_DIR . '/buddypress/bp-loader.php' );


if ( !defined( 'BP_MAPS_SLUG' ) )
define ( 'BP_MAPS_SLUG', __('maps','bp-maps-slugs') );


if ( !defined( 'BP_MAPS_IS_INSTALLED' ) )
define ( 'BP_MAPS_IS_INSTALLED', 1 );

if ( !defined( 'BP_MAPS_VERSION' ) )
define ( 'BP_MAPS_VERSION', '0.30' );

if ( !defined( 'BP_MAPS_DB_VERSION' ) )
define ( 'BP_MAPS_DB_VERSION', '1100' );

if ( !defined( 'BP_MAPS_PLUGIN_NAME' ) )
define ( 'BP_MAPS_PLUGIN_NAME', 'buddypress-maps' );

if ( !defined( 'BP_MAPS_PLUGIN_URL' ) )
define ( 'BP_MAPS_PLUGIN_URL', WP_PLUGIN_URL . '/' . BP_MAPS_PLUGIN_NAME );

if ( !defined( 'BP_MAPS_PLUGIN_DIR' ) )
define ( 'BP_MAPS_PLUGIN_DIR', WP_PLUGIN_DIR . '/' . BP_MAPS_PLUGIN_NAME );


require_once( dirname( __FILE__ ) . '/bp-maps.php' );
}
add_action( 'bp_init', 'bp_maps_init' );

You can find there some additional code, but after all that debugging I’m too lazy to remove all constants-check stuff..

Important: Edit code in buddypress-maps.php!!! Don’t create new file loader.php as you can find in some forums or articles!!! ( There are also some references in bp-maps.php on function bp_maps_init.. )

Still nothing? Than edit typo in bp-maps.php (it should be line 594.) missing end tag for php comment. From “/*******” to “/********/”. (Some server configurations may find this ok..).


This entry was posted in Professional, Wordpress and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>