--- statuses-upgrade-path-1501978-27.patch	Mon Jul 30 11:48:15 2012
+++ statuses-upgrade-path-1501978-29.patch	Mon Jul 30 19:18:30 2012
@@ -1,5 +1,5 @@
 diff --git a/statuses.install b/statuses.install
-index 3bb5d68..b7f17dd 100644
+index 3bb5d68..86d29f2 100644
 --- a/statuses.install
 +++ b/statuses.install
 @@ -60,15 +60,6 @@ function statuses_schema() {
@@ -18,7 +18,7 @@
    $schema['statuses_contexts'] = array(
      'description' => 'Stores stream context configurations.',
      'fields' => array(
-@@ -128,6 +119,97 @@ function _statuses_contexts_schema() {
+@@ -128,6 +119,98 @@ function _statuses_contexts_schema() {
  }
  
  /**
@@ -58,7 +58,8 @@
 +    ");
 +
 +    // Delete old tables.
-+    drupal_uninstall_schema('facebook_status');
++    db_drop_table('facebook_status');
++    db_drop_table('facebook_status_contexts');
 +
 +    // Convert old settings.
 +    variable_set('statuses_default_text_other', variable_get('facebook_status_default_text_other', ''));
@@ -304,7 +305,7 @@
   */
  function fbss_userpoints_uninstall() {
 diff --git a/submodules/statuses_tags/statuses_tags.install b/submodules/statuses_tags/statuses_tags.install
-index be0c4d2..959ba95 100644
+index be0c4d2..f493b46 100644
 --- a/submodules/statuses_tags/statuses_tags.install
 +++ b/submodules/statuses_tags/statuses_tags.install
 @@ -2,8 +2,7 @@
@@ -317,8 +318,20 @@
   */
  
  /**
-@@ -57,8 +56,8 @@ function statuses_tags_schema() {
+@@ -55,10 +54,20 @@ function statuses_tags_schema() {
+  * Implements hook_install().
+  */
  function statuses_tags_install() {
++  /**
++   * When upgrading from facebook_status a normal update hook won't register
++   * because we are installing the "statuses" module for the first time. To get
++   * around this, we force the update hook to run during installation.
++   */
++  $sandbox = array();
++  $result = _statuses_tags_update_7100($sandbox);
++  if ($result) {
++    drupal_set_message($result);
++  }
    if (module_exists('taxonomy')) {
      // Check to see if the vocabulary already existed (i.e. from a previous installation).
 -    $already_exists = db_query("SELECT vid, name FROM {taxonomy_vocabulary} WHERE module = :module", array(':module' => 'statuses_tags'))->fetchObject();
@@ -328,31 +341,15 @@
        variable_set('statuses_tags_vid', $already_exists->vid);
        drupal_set_message(st('The vocabulary "@name" has been configured for use with the Statuses Tags module.', array('@name' => $already_exists->name)));
        return;
-@@ -74,13 +73,23 @@ function statuses_tags_install() {
+@@ -74,7 +83,7 @@ function statuses_tags_install() {
      );
      taxonomy_vocabulary_save($vocabulary);
      $vid = isset($vocabulary->vid) ? $vocabulary->vid :
 -      db_query("SELECT vid FROM {taxonomy_vocabulary} WHERE machine_name = :name AND module = :module", array(':name' => 'hashtags', ':module' => 'statuses_tags'))->fetchField();
-+      db_query("SELECT vid FROM {taxonomy_vocabulary} WHERE machine_name = 'hashtags' AND module = 'statuses_tags'")->fetchField();
++    db_query("SELECT vid FROM {taxonomy_vocabulary} WHERE machine_name = 'hashtags' AND module = 'statuses_tags'")->fetchField();
      variable_set('statuses_tags_vid', $vid);
      drupal_set_message(st('The vocabulary "Hashtags" has been created and configured for use with the Statuses Tags module.'));
    }
-   else {
-     drupal_set_message(st('Statuses Tags only allows using #hashtags when the Taxonomy module is installed.'));
-   }
-+  /**
-+   * When upgrading from facebook_status a normal update hook won't register
-+   * because we are installing the "statuses" module for the first time. To get
-+   * around this, we force the update hook to run during installation.
-+   */
-+  $sandbox = array();
-+  $result = _statuses_tags_update_7100($sandbox);
-+  if ($result) {
-+    drupal_set_message($result);
-+  }
- }
- 
- /**
 @@ -113,3 +122,48 @@ function statuses_tags_uninstall() {
    // FBSST is ever installed again.
    //variable_del('statuses_tags_alt_pattern');
@@ -374,10 +371,10 @@
 +    ");
 +
 +    // Delete old tables.
-+    drupal_uninstall_schema('facebook_status_tags');
++    db_drop_table('facebook_status_tags');
 +
 +    // Update the vocabulary.
-+    if (variable_get('facebook_status_tags_vid', -1) != -1) {
++    if (variable_get('facebook_status_tags_vid', -1) != -1 && db_table_exists('taxonomy_vocabulary')) {
 +      db_update('taxonomy_vocabulary')
 +        ->fields(array(
 +          'machine_name' => 'hashtags',
