? 203223_comment_notify_6.x_upgrade.patch
Index: comment_notify.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/comment_notify/Attic/comment_notify.info,v
retrieving revision 1.1.2.2
diff -u -p -r1.1.2.2 comment_notify.info
--- comment_notify.info	19 Jan 2008 12:49:05 -0000	1.1.2.2
+++ comment_notify.info	29 Apr 2008 21:27:26 -0000
@@ -2,3 +2,4 @@
 name = Comment Notify
 description = "Comment follow-up e-mail notification for anonymous as well as registered users."
 dependencies = comment
+core=6.x
Index: comment_notify.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/comment_notify/comment_notify.module,v
retrieving revision 1.1.4.9
diff -u -p -r1.1.4.9 comment_notify.module
--- comment_notify.module	19 Mar 2008 02:26:38 -0000	1.1.4.9
+++ comment_notify.module	29 Apr 2008 21:27:27 -0000
@@ -37,8 +37,8 @@ Webmaster of !site
 /**
  * Implementation of hook_help().
  */
-function comment_notify_help($section) {
-  switch ($section) {
+function comment_notify_help($path, $arg) {
+  switch ($path) {
     case 'admin/modules#description':
       return t('Comment follow-up e-mail notification for anonymous and registered users.');
       break;
@@ -46,10 +46,9 @@ function comment_notify_help($section) {
 }
 
 /**
- * Insert our checkbox, and populate fields.
- * set validation hook.
+ * Implementation of hook_form_alter to insert our checkbox, populate fields, and set validation hook.
  */
-function comment_notify_form_alter($form_id, &$form) {
+function comment_notify_form_alter(&$form, &$form_state, $form_id) {
   global $user;
 
   if ($form_id != 'comment_form') {
@@ -108,30 +107,24 @@ function comment_notify_perm() {
 /**
  * Implementation of hook_menu().
  */
-function comment_notify_menu($may_cache) {
+function comment_notify_menu() {
   $items = array();
-  global $user;
 
-  if ($may_cache) {
-    $items[] = array(
-      'path' => 'admin/settings/comment_notify',
-      'title' => t('Comment Notify'),
-      'callback' => 'drupal_get_form',
-      'description' => t('Configure settings for e-mails about new comment.'),
-      'callback arguments' => array('comment_notify_settings'),
-      'access' => user_access('Administer comment notify'),
-      'type' => MENU_NORMAL_ITEM
-    );
-  }
-  else {
-    $items[] = array(
-      'path' => 'comment_notify',
-      'title' => t('comment notify') ,
-      'callback' => 'comment_notify_page',
-      'access' => 1,
-      'type' => MENU_CALLBACK
-    );
-  }
+  $items['admin/settings/comment_notify'] = array(
+    'title' => 'Comment Notify',
+    'page callback' => 'drupal_get_form',
+    'description' => 'Configure settings for e-mails about new comment.',
+    'page arguments' => array('comment_notify_settings'),
+    'access arguments' => 'Administer comment notify',
+    'type' => MENU_NORMAL_ITEM
+  );
+  $items['comment_notify'] = array(
+    'title' => 'comment notify',
+    'page callback' => 'comment_notify_page',
+    'access' => TRUE,
+    'type' => MENU_CALLBACK
+  );
+
   return $items;
 }
 
@@ -174,11 +167,11 @@ function comment_notify_page() {
 /**
  * save our data.
  */
-function comment_notify_validate($form_id, $form_values) {
+function comment_notify_validate($form, &$form_state) {
 
-  if ($form_values['optin']) {
+  if ($form_state['values']['optin']) {
     foreach (array('optin') as $field) {
-      $_SESSION['comment_notify'][$field] = $form_values[$field];
+      $_SESSION['comment_notify'][$field] = $form_state['values'][$field];
     }
   }
   else {
@@ -237,7 +230,7 @@ function comment_notify_user($type, &$ed
 
 function _comment_notify_mailalert($comment) {
   $comment = (object) $comment;
-  global $locale;
+  global $language;
   global $base_url;
 
   $initial_locale = $locale;
@@ -289,7 +282,7 @@ function _comment_notify_mailalert($comm
           '!commname' => $commname,
           '!commtext' => $commtext,
           '!commsubj' => $commsubj,
-          '!comment_url' => url('node/'. $nid, NULL, NULL, 1) .'#comment-'. $cid,
+          '!comment_url' => url('node/'. $nid, array('absolute' => 1, 'fragment' => 'comment-'. $cid)),
           '!node_title' =>  $node->title,
           '!node_teaser' => $node->teaser,
           '!mission' => variable_get('site_mission', ''),
@@ -299,9 +292,9 @@ function _comment_notify_mailalert($comm
           '!uri' => $base_url,
           '!uri_brief' => substr($base_url, strlen('http://')),
           '!date' => format_date(time()),
-          '!login_uri' => url('user', NULL, NULL, 1),
-          '!edit_uri' => url('user/'. $alert->uid .'/edit', NULL, NULL, 1),
-          '!link1' => url('comment_notify/disable/'. $alert->mymd5, NULL, NULL, 1)
+          '!login_uri' => url('user', array('absolute' => TRUE)),
+          '!edit_uri' => url('user/'. $alert->uid .'/edit', array('absolute' => TRUE)),
+          '!link1' => url('comment_notify/disable/'. $alert->mymd5, array('absolute' => TRUE))
         )
       );
 
@@ -316,8 +309,8 @@ function _comment_notify_mailalert($comm
       }
 
       // Add an entry to the watchdog log.
-      watchdog('comment_notify', t('Notify ') . $mylink,
-      WATCHDOG_NOTICE, l(t('source comment'), 'node/'. $nid, NULL, NULL, 'comment-'. $alert->cid));
+      watchdog('comment_notify', 'Notify %my_link', array('%my_link' => $mylink),
+               WATCHDOG_NOTICE, l(t('source comment'), 'node/'. $nid, array('fragment' => 'comment-'. $alert->cid)));
 
       // revert to previous (site default) locale
       $locale = $initial_locale;
