From b5e696702df6df3a0bd09f44758bd8c73004c657 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Tue, 8 Jun 2010 03:48:14 +0000 Subject: #794184 by JacobSingh, catch, chx: Fixed contact_update_7002() fails when the contact module is not enabled. --- modules/contact/contact.install | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'modules/contact') 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 @@ -89,18 +89,6 @@ function contact_uninstall() { variable_del('contact_threshold_window'); } -/** - * 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(); } /** -- cgit v1.2.3