Index: cck_field_privacy.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/cck_field_privacy/cck_field_privacy.module,v
retrieving revision 1.3.2.2.2.6
diff -u -r1.3.2.2.2.6 cck_field_privacy.module
--- cck_field_privacy.module	6 Dec 2008 20:38:49 -0000	1.3.2.2.2.6
+++ cck_field_privacy.module	22 Dec 2008 05:21:50 -0000
@@ -190,16 +190,22 @@
                 // Add the padlock icon & link to the JQuery function
                 // @TODO: Add this via jQuery to degrade gracefully in browsers without JavaScript enabled.
                 // @TODO: Get the padlock to also appear on field group titles (fieldset legends), if selected.
-                if (isset($form[$field]['#title'])) {
-                  $form[$field]['#title'] .= "<a href='#' id='". $field ."link' ><img src='". base_path() . drupal_get_path('module', 'cck_field_privacy') ."/padlock.png' /></a>";
-                }
                 if (isset($form_field['#title'])) {
                   $form_field['#title'] .= "<a href='#' id='". $field ."link' ><img src='". base_path() . drupal_get_path('module', 'cck_field_privacy') ."/padlock.png' /></a>";
+                  //email fields are special, they must be handled a bit differently.
+                  if ($form[$field][0]['#type'] == "email_textfield") {
+                    $form['#field_info'][$field]['widget']['label'] .= "<a href='#' id='". $field ."link' ><img src='". base_path() . drupal_get_path('module', 'cck_field_privacy') ."/padlock.png' /></a>";
+                  }
                 }
-                if (isset($form_field[0]['#title'])) {
+                else if (isset($form[$field]['#title'])) {
+                  $form[$field]['#title'] .= "<a href='#' id='". $field ."link' ><img src='". base_path() . drupal_get_path('module', 'cck_field_privacy') ."/padlock.png' /></a>";
+                }
+                else if (isset($form_field[0]['#title'])) {
                   $form_field[0]['#title'] .= "<a href='#' id='". $field ."link' ><img src='". base_path() . drupal_get_path('module', 'cck_field_privacy') ."/padlock.png' /></a>";
                 }
-                $form['#field_info'][$field]['widget']['label'] .= "<a href='#' id='". $field ."link' ><img src='". base_path() . drupal_get_path('module', 'cck_field_privacy') ."/padlock.png' /></a>";
+                else {
+                  $form['#field_info'][$field]['widget']['label'] .= "<a href='#' id='". $field ."link' ><img src='". base_path() . drupal_get_path('module', 'cck_field_privacy') ."/padlock.png' /></a>";
+                }
               }
             }
           }

