hook_uninstall() is incomplete
| Project: | Drupal for Facebook |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Because DFF is still in dev status, this should probably be a feature request.
Uninstalling DFF does drop the tables, but not all the other stuff that got written to the database. After messing up my Facebook Connect Block (i changed the default Title to <none>), the block disappeared for good. Clearing Caches, Cookies, Sessions, deleting the FB app, logout from FB, ... plus deleting all entries from authmap that contained "@facebook.com" was not enough to fix this problem.
Performing a search for "fb_" in phpmyadmin, and deleting all the stuff beginning with "fb_" did it. I was able to create a new FB app and now the Connect Block is showing and working.
I don't know which submodule needs what:
<?php
function fb_uninstall() {
// probably fb_uninstall() of fb_app
$fb_apps = db_query("SELECT nid FROM {node} WHERE type = 'fb_app'");
while ($fb_app = db_fetch_object($fb_apps)) {
node_delete($fb_app->nid);
}
// probably fb_uninstall() of fb_devel
db_query("DELETE FROM {blocks} WHERE module = 'fb_devel'");
// probably fb_uninstall() of fb_connect
db_query("DELETE FROM {blocks} WHERE module = 'fb_connect'");
// probably fb_uninstall() of fb_connect
variable_del('fb_connect_primary_apikey');
// probably fb_uninstall() of fb_connect
$result = db_query("SELECT sid FROM {sessions} WHERE sid LIKE 'fb_connect_%'");
while ($row = db_fetch_object($result)) {
db_query("DELETE FROM {sessions} WHERE sid = '%s' LIMIT 1", $row->sid);
}
// probably fb_uninstall() of fb_connect
$result = db_query("SELECT authname FROM {authmap} WHERE authname LIKE '%facebook.com'");
while ($row = db_fetch_object($result)) {
db_query("DELETE FROM {authmap} WHERE authname = '%s' LIMIT 1", $row->authname);
}
}
?>
#1
Copy & Paste... Above I'm talking about hook_uninstall() NOT fb_uninstall().
#2
Edit: A more meaningfull title.
#3
You're right that uninstall needs to improve before I go from dev release to 1.0. thanks for the code, I'll have to edit it and put it into the right modules, but much of it is good.
I think the block was not appearing only because of input filters. If you save any changes to that block, you have to be sure the input format allows XFBML markup. So I think the block was there but all content was filtered out. (I can't think of any other reason for what you describe).
I don't think there's much I can do to make that more obvious, its just one of those drupal things.
#4
I don't see where I can allow XFBML.
#5
Just don't have the HTML filter on. So picking Drupal's default "full html" or "php code" would work. On the page where you configure the block it has the same input format selector as in node edit form.