summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpcambra2013-06-04 19:00:47 (GMT)
committer Juampy2013-06-04 19:00:47 (GMT)
commitbdd2f9e81c59da8b40d810306783e009ad10eaa5 (patch)
tree2e4abb2caa079db7c73209d102a13f9c817acdda
parent588e062240c53b1c01d6a73dc2eea419262191dd (diff)
Issue #2011976 by pcambra: Fix call to the system table on install.
-rw-r--r--twitter.install8
-rw-r--r--twitter_post/twitter_post.install21
2 files changed, 6 insertions, 23 deletions
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.');
-}