Topic on Talk:BlueSpice

BlueSpice doesn't work when GoogleLogin extension is enabled

2
Summary by RichardHeigl

There will be a new solution coming during this year.

Khan.tauseef (talkcontribs)

Hi,

I have BlueSpice extension installed along with the GoogleLogin. whenever I try to login to my wiki i get this following error.

2016/02/07 19:49:07 [error] 7983#0: *27223 FastCGI sent in stderr: "PHP message: PHP Fatal error: Cannot redeclare class UserPreferences in /var/www/deploys/wiki2/extensions/BlueSpiceExtensions/UserPreferences/UserPreferences.class.php on line 227" while reading response header from upstream, client: 82.82.189.99, server: wiki2.spotcap.com, request: "GET /index.php?title=Main_Page HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "wiki2.spotcap.com", referrer: "https://wiki2.spotcap.com/index.php?title=Special:UserLogin"

But when I disable any one of them; either BlueSpice or GoogleLogin then the error disappears. Can someone help please?

thanks.

Osnard (talkcontribs)

Hi,

I assume the Preferences class get's loaded by a hook too early and then the "ExtensionManager" component crashes. You can try to modify BlueSpiceFoundation/includes/ExtensionManager.class.php from line 87 on:

foreach ( self::$prRegisteredExtensions as $extension => $attributes ) {
		if ( $attributes['baseDir'] != 'ext' ) {
			if( !class_exists( $extension, false ) ) {
				require( $attributes['baseDir'] . DS . $extension . '.class.php' );
			}
		} else {
			if( !class_exists( $extension, false ) ) {
				require( $path . DS . $extension . DS . $extension . '.class.php' );
			}
		}
		self::$aIncludedClasses[] = $extension;
}

Maybe it is also sufficient to change the require statements to require_once.

If it works, please give me a short Feedback so I can add it to the code base.