When upgrading from email.module,v 1.9.2.3 2007/04/17 to email.module,v 1.9.2.8 2008/04/15 I lost the possibility to change the link type in the widget settings of an email field. When downgrading to the prior version, the prior settings are showing up again.

In email.module,v 1.9.2.8, the code is not operating on variable $field['widget']['link_type'] == 'form' anymore.

Any hints to fix this issue?

Devr

CommentFileSizeAuthor
#3 email.patch628 bytestumblingmug

Comments

tumblingmug’s picture

The same for me. That's why I had to roll back to prior version as well.

tumblingmug’s picture

Version: 5.x-1.x-dev » 5.x-1.0

The same in the 5.x-1.0 version. I cannot find a bit of documentation about this. Why the change in the module's code to the function "email_field_formatter()" and how have I to deal with it to make the contact form working. Can anybody provide a hint?

tumblingmug’s picture

StatusFileSize
new628 bytes

OK - I've found a solution. It's all about CCK Field Formatters. So the last changes in the email module are the consequence of a decision: whether you want a pure email-field (as a mailto:), an invisimail or even an email form - this is handled from now on as a formatting issue. So you have to do the trick in the (con)templates by using a CCK function called content_format().

For me, it was a change in the node-sometype.tpl.php: I had to change from

     print $node->field_email[0]['view'];

to another more CCK like approach:

     print content_format('field_email', $field_email[0], 'contact', $node );

where the "contact" parameter means: give me a link to a contact form rather than the default plain mailto link.

Once you've done this, unfortunately not all work is done. You get the desired link to the contact form, but after clicking it instead of the form appears a "404 - not found" page. For me it was the following patch to solve this:

--- email.module-orig   2008-09-28 17:43:10.000000000 +0200
+++ email.module        2008-09-28 17:44:33.000000000 +0200
@@ -222,9 +222,7 @@ function email_mail_page($nid=null, $fie
   // Validate field name
   $types = content_types($node->type);
   if (!isset($types['fields'][$fieldname]) ||
-      $types['fields'][$fieldname]['type'] != 'email' ||
-      ($types['fields'][$fieldname]['display_settings']['teaser']['format'] != 'contact' &&
-      $types['fields'][$fieldname]['display_settings']['full']['format'] != 'contact')) {
+      $types['fields'][$fieldname]['type'] != 'email') {
     drupal_not_found();
     return;
   }

The key ['display_settings'] is always empty in my case so that the condition for returning the 404 was always TRUE. Maybe it's a bug of the email module, I don't know.

However, I am not happy with the eleminated radio buttons so that one can no more configure the desired behaviour by a simple click in the email form settings. Instead and because the lack of documentation you have to dive into the code to see what's going on. This is not userfriendly at all and I would be happier with the older versions of the email module. To be honest: it is not a formatting issue if I want this or that behaviour. The radios should be rolled back into the code.

And I do not understand at all why within a branch (Drupal 5 in this case) unnecessary design changes in modules, e.g. email, are made. This makes troubles for sure if you upgrade your installation. And we all have to. So we are forced to dive into developing our installation again and again. Nobody loves this.