summaryrefslogtreecommitdiff
path: root/modules/contact
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-06-08 03:48:14 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-06-08 03:48:14 +0000
commitb5e696702df6df3a0bd09f44758bd8c73004c657 (patch)
tree9e3cf8edfb303283d4a711a9c8c13a876a4a1b4a /modules/contact
parent70dd028d18b96e3c974900c26b20bbd8e7d97399 (diff)
downloadbrdo-b5e696702df6df3a0bd09f44758bd8c73004c657.tar.gz
brdo-b5e696702df6df3a0bd09f44758bd8c73004c657.tar.bz2
#794184 by JacobSingh, catch, chx: Fixed contact_update_7002() fails when the contact module is not enabled.
Diffstat (limited to 'modules/contact')
-rw-r--r--modules/contact/contact.install23
1 files changed, 10 insertions, 13 deletions
diff --git a/modules/contact/contact.install b/modules/contact/contact.install
index 5ec5dcbcd..435156ded 100644
--- a/modules/contact/contact.install
+++ b/modules/contact/contact.install
@@ -90,18 +90,6 @@ function contact_uninstall() {
}
/**
- * Implements hook_update_dependencies().
- */
-function contact_update_dependencies() {
- // Contact update 7002 calls the new user_role_grant_permissions() and
- // therefore needs to run after user_update_7006();
- $dependencies['contact'][7002] = array(
- 'user' => 7006,
- );
- return $dependencies;
-}
-
-/**
* @defgroup updates-6.x-to-7.x Contact updates from 6.x to 7.x
* @{
*/
@@ -128,7 +116,16 @@ function contact_update_7001() {
* Enable the 'access user contact forms' for registered users by default.
*/
function contact_update_7002() {
- user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('access user contact forms'));
+ // Do not use user_role_grant_permission() since it relies on
+ // hook_permission(), which will not run for contact module if it is
+ // disabled.
+ db_merge('role_permission')
+ ->key(array(
+ 'rid' => DRUPAL_AUTHENTICATED_RID,
+ 'permission' => 'access user contact forms',
+ 'module' => 'contact',
+ ))
+ ->execute();
}
/**