rollback(); watchdog_exception('php', $e); drupal_set_message($t('Cannot create new fields'), 'error'); } } /** * Implements hook_uninstall(). */ function comment_counter_uninstall() { $t = get_t(); $transaction = db_transaction(); try { $query = " ALTER TABLE {node_comment_statistics} DROP COLUMN `comment_day_count`, DROP COLUMN `comment_week_count`, DROP COLUMN `comment_month_count`, DROP COLUMN `comment_year_count` "; db_query($query); variable_del('comment_counter_timestamp'); variable_del('comment_counter_count_comments'); // Ignore slave server temporarily to give time for the // saved block to be propagated to the slave. db_ignore_slave(); } catch (Exception $e) { $transaction->rollback(); watchdog_exception('php', $e); drupal_set_message($t('Cannot drop fields'), 'error'); } }