diff --git a/twitter.install b/twitter.install index e721596..9392922 100644 --- a/twitter.install +++ b/twitter.install @@ -322,13 +322,7 @@ function twitter_schema() { */ function twitter_install() { // Set the weight to 3, making it heavier than Pathauto. - db_update('system') - ->fields(array( - 'weight' => 3, - )) - ->condition('type', 'module') - ->condition('name', 'twitter') - ->execute(); + module_set_weight('twitter', 3); } /** diff --git a/twitter_post/twitter_post.install b/twitter_post/twitter_post.install index bf300c2..7056708 100644 --- a/twitter_post/twitter_post.install +++ b/twitter_post/twitter_post.install @@ -30,7 +30,11 @@ function twitter_post_field_schema($field) { /** * Implements hook_install(). */ -function twitter_post_install() {} +function twitter_post_install() { + // Set the weight to 10, making it heavier than Pathauto. + module_set_weight('twitter_post', 10); + return t('Updated system weight to 10 for Twitter Post.'); +} /** * Implements hook_enable(). @@ -54,18 +58,3 @@ function twitter_post_update_7300() { } return t('Twitter Post now defaults to using aliases, not TinyURL.'); } - -/** - * Implements hook_update_N(). - * - * Increase module weight to run after pathauto. - */ -function twitter_post_update_7301() { - db_update('system') - ->fields(array( - 'weight' => 10, - )) - ->condition('name', 'twitter_post', '=') - ->execute(); - return t('Updated system weight to 10 for Twitter Post.'); -}