Drupal for facebook fatal errors
In a Drupal based installation that uses FaceBook comments, I was getting "fatal errors" whenever I put the site down for maintenance and once when the ISP took the site down for scheduled maintenance itself. Those errors made the site completely inoperable.
Fatal error: Call to undefined function fb_settings() in ../fb/fb.module on line 755
I was using the module "Drupal for Facebook" by David Cohen (machine name = fb) which I have found to be very well coded. However, the documentation was lacking and his warnings not to ask him "simple" questions to be very intimidating to those of us who are not already experts. I understand his concern that people can take (and probably have taken) advantage of his knowledge. However, he can't expect everybody to be at the same level as he is. A little diplomacy might help him find a middle ground that will respect him as a volunteer he deserves and help guide us so we can make use of his work.
With a little experimentation I learned that to recover from the error, all I had to do was reinstall the module. But I had to do this each and every time I put the site in maintenance mode. I found the answer in the README.txt file included in the project even though there was no indication that it would help the situation I was in.
Also, this occurred early enough in the bootstrap process that it happened with any theme and closed all obvious entrances to the site. I had to go around back and use the door “phpmyadmin” and disable the facebook-for-drupal module directly in the system table for this installation and then re-enable the modules and sub-modules. For thouroughness sake I could have uninstalled the module, but a little bit of data already existed and I didn't want to have to reenter.
The README.txt file lists a couple of lines that are needed if you are going to be using a canvas, or tab. From FaceBooks documentation I thought the "social plugins" I used ("fb:like" and "fb:comment") were ways to avoid creating tabs or canvases so I didn't think those lines pertained to me. You needed to put them in the settings file which is usually at sites/default/settings.php.
Once I put these lines in, ran the query (see below), loged-in to the site again, and cleared the cache I didn't have to worry again. I'm not completely sure emptying the cache was necessary.
So to reiterate the steps
- This query line that made the fatal error temporarily go away so that you could enter the Drupal system again. It simply disabled the facebook modules.
- update 'system';
- set status = 0
- where name like 'fb%'
Include the following text in the Settings.php file to solve the problem going into the maintenance mode.
- include "sites/all/modules/fb/fb_url_rewrite.inc";
- include "sites/all/modules/fb/fb_settings.inc";
- Enable the facebook modules wanted.
cleared cache tables in the database