Fatal error: Cannot redeclare class facebook in /home/topnet/public_html/x.com/sites/all/modules/dcl_importer/OpenInviter/plugins/facebook.php on line 232

this is what I get when I go to admin/settings/dcl_importer

Comments

hadsie’s picture

Are you using another facebook module? My guess is that it also has a class called "facebook" and that's triggering the issue. If you don't need to use facebook for importing contacts (which doesn't work very well with openinviter anyway) I think it's safe to simply delete the facebook.php file you listed here.

drupallogic’s picture

Yes,I'm using Facebook Connect.

it's ok now after deleting Facebook file.

giorgio79’s picture

Can we rename it to dcl_facebook to make it specific, there are many FB modules now for Drupal :)

hadsie’s picture

Unfortunately this is code that comes with the OpenInviter library, so there's not really anything I can do about it short of submitting an issue to them to rename the class.

hadsie’s picture

Title: Error with OpenInviter » Conflict with openinviter facebook class and other facebook modules

Renaming the issue to be more representative of what's happening.

hadsie’s picture

Status: Active » Closed (won't fix)

I'm marking this as won't fix. I don't have a solution for this problem since both the facebook module and openinviter are out of my control. I would advise posting a feature request to the facebook module and getting them to prefix the class to give it a semi-namespaced name (drupal style namespaces) since php didn't support proper name spaces until 5.3 or something.

Dave Cohen’s picture

The facebook class is defined by facebook's PHP sdk. The drupal modules have no control over it. Really its kind of dumb of openinviter to use that class name.

I'm looking for a workaround so if anyone has one, please get in touch.

ibandyop’s picture

To avoid the name clash and fix the error

Fatal error: Cannot redeclare class facebook in .../facebook.plg.php on line ...

I opened the file sites/all/libraries/OpenInviter/conf/facebook.conf and disabled it as shown below

<?php $enable=false;$autoUpdate=false;$messageDelay=2;$maxMessages=10;?>

Using D7.10 and OpenInviter 1.96