I was using the 6.x-2.x-dev version that had this info in the .module file: v 1.1.2.14 2010/04/23 12:35:17

I recently updated the module on my dev site to the latest release of 6.x-2.x-dev ... the one that now allows drag-and-drop for rearranging fields.

The newest release is no longer compatible with the Contact Forms module.

I am using the Contact Forms module to allow for different forms for different departments for our newspaper (different forms that go to different email addresses for "Webmaster," "Editor," "Classifieds," etc.).

The version of Contact Form Fields that I was using did not interfere with the forms created by Contact Forms. However, after installing the latest release, I discovered that the Subject line in all of the forms created by the Contact Forms module now appears BELOW the Message field ... even though the order is correct in the Manage Fields page. And this is BEFORE creating any new fields with the Contact Form Fields module. The moment I uninstalled the Contact Form Fields module, the fields in the forms created by the Contact Forms module went back to the correct order.

I'd really like to be able to use these modules together. Any suggestions?

CommentFileSizeAuthor
#3 manage_fields.png28.71 KBKatrina B
#3 contact_form.png38.21 KBKatrina B

Comments

beautifulmind’s picture

Okay. I'll give due consideration to this issue.
Thank for pointing this out. The module is still in development phase.

Regards.

beautifulmind’s picture

Status: Active » Fixed

Please try the latest dev version. That should fix the issue of fields not appearing on contact form after upgrading to 2.x

Thank you very much for your concern.

Regards.

Katrina B’s picture

Status: Fixed » Active
StatusFileSize
new38.21 KB
new28.71 KB

Actually, it’s not a problem of the new fields not appearing ... it's that after I install the Contact Fields module, the Subject field gets shoved to the bottom of the form on the individual forms created by the Contact Forms module.

I uninstalled (completely) the previous Contact Fields module and installed the new dev version ... and I'm still having the same problem.

As you can see from the attached screenshots, the fields are in the correct order in the Manage Fields page (manage_fields.png). But in the individual contact forms created by the Contact Forms module (contact_form.png), the Subject field is in the wrong place.

This is only the case in the individual forms created by the Contact Forms module; on the general contact form, the fields are in the correct order.

beautifulmind’s picture

Yes, the issue has been solved in latest dev version.

[edit] Please compare the table header with the values under it. This problem along with the weight issue has been fully solved.
Regards.

beautifulmind’s picture

Status: Active » Fixed
beautifulmind’s picture

Hello,
Thanks for your concern. I really appreciate it.
I need some more information about the issue. Will you please let me know that was it a clean installation or an update? That would help me in re-generating and fixing the issue by testing on some of my live sites.

Thanks a lot.

Regards.

Katrina B’s picture

I tried both. I tried installing the new dev version over the old one ... same result. I tried entirely uninstalling the Contact Field module (I even ran update.php after the complete uninstall), then did a clean install. Same result. On the contact forms for the individual categories, "Subject" is the last field displayed, even though it's in the right place on the general Contact form.

beautifulmind’s picture

Okay. Thanks for raising the issue.
I'll give you an update in a day.

Regards.

beautifulmind’s picture

Status: Fixed » Closed (fixed)
beautifulmind’s picture

Okay.
Can you please send me a snap shot of contact_fields table?

Regards.

Katrina B’s picture

Do you mean the table in the Manage fields page? Or something else? If you are referring to the table in the Manage fields page, it still looks just like the screenshot attached to comment #3 above.

beautifulmind’s picture

Okay. I've found the remedy. Go to Contact_fields table in your database and remove the row having 'subject'. Now, go to manage fields page. You will now able to rearrange subject field. Also, use the latest dev version (August 7) which has some more fixes done.

Thanks for your concern and using the module. I really appreciate it.
Regards.

Katrina B’s picture

Unfortunately, I have no idea how to remove the subject field from the table in the database; I only work on the website through the Internet interface; I don't tamper with the databases at all, and I would have no idea what I was doing if I tried; I'm a graphic designer, not a coder, programmer, or developer.

I appreciate the time and effort you've put into this, though.

beautifulmind’s picture

No problem.
If you are working as a team, please ask one of the developer to do this. That will definitely fix the issue.
Also, as this issue is raised, I'm planing to place a link to re-calculate, re-arrange core fields on the manage fields page.
Thanks for the idea and using the module. I really appreciate it.

Regards.

Katrina B’s picture

It may be a while before I can get a tech to do this for me; we have about ten other items on the "high priority" list for the "live" site that need to be done first.

I'm still using an old version of the Contact Fields module on the "live" site (a version from May 2010, I believe ... the last version that doesn't rearrange the Subject field); I won't put a new, updated version on the "live" site until all the bugs are worked out. (That's what the dev site is for.)

I have only part-time access to two techs, who have a lot of other projects on their plates besides mine, so I have to be judicious about what I ask for.

beautifulmind’s picture

Status: Active » Postponed (maintainer needs more info)
beautifulmind’s picture

Category: bug » support
howartp’s picture

Status: Postponed (maintainer needs more info) » Needs work

Hi BeautifulMind,

I've just had a look at this, but can't work out what's happening.

I'm using 6.x-2.x-dev, with one ContactForms category and no added ContactFormFields.

Using a few echo() statements, i've proved that the weight fields in $form look like the following after contact_field_form_alter() has processed it:

$form[name][#weight] => -10
$form[mail][#weight] => -9
$form[subject][#weight] => -8
$form[cid][#weight] => -7
$form[message][#weight] => -6
$form[copy][#weight] => -5
$form[submit][#weight] => -4

So at this point, it appears Subject is weighted correctly. However by the time it is printed to the page by whichever form function is responsible, Subject is further down. Whether this is due to weighting or some bug elsewhere I'm not sure. (It certainly isn't CSS that's floating it lower than it should be, I did check that).

I think I'm right that contact_field_form_alter() is the last time contact_field touches the form? So are you incorrectly forming $form[blah] or is there a bug elsewhere which isn't understanding your $form() modifications?

The fact remains that as soon as you uninstall contact_field, the forms display correctly.

Peter

beautifulmind’s picture

Hello,
Thank you for your concern and raising the issue. I'll definitely look in to this issue and will fix it ASAP.

Thank you.

Regards.

beautifulmind’s picture

#20
I've fixed the issue and committed the changes as well. You should be able to see the chnages in 24 hours, after the drupal.org cron runs. Try the dev version with updated date set to today.

Thank you.

beautifulmind’s picture

Status: Needs work » Closed (fixed)
Steve -cc’s picture

Version: 6.x-2.x-dev » 6.x-2.2

Hi i just installed 6.22 to try to add a phone number field to my sites contact forms. I am having the same problem that is described above - form is correct for generic contact form but not for specific forms by category.

beautifulmind’s picture

Okay.
This is about 'contact forms' and not about 'contact' module itself.
Let me explain,
'Contact forms' splits the form based on the category and it does not know about 'Contact form fields' module. To display all the fields added using contact form fields, the 'contact forms' module has to look in the table of contact form fields module. So, I believe, there a patch or two required in 'contact forms' rather in 'Contact form fields'.

Regards.

behindthepage’s picture

Hi Beautifulmind,

I am the developer of Contact Forms and if I understand correctly the problem is the order of the fields are being mucked up.

The problem is in the order that our modules are being run. Your module's hook_form_alter needs to be run after mine. This can be achieved by making "Contact Fields" weight in the system table "heavier" than "Contact Forms" weight. If the weight is the same they are run in alphabetical order.

Add this to your .install file

/**
 * Implementation of hook_enable(). Make this module heavy to encourage Drupal
 * to run its hooks after the Contact Forms module's hooks.
 *
 * @return None.
 */
function contact_field_enable() {
    
  if (module_exists('contact_forms')) {

    $alWeight = db_result(db_query("SELECT weight FROM system WHERE `name` = 'contact_forms'"));

    $alWeight += 1;

    $query = "UPDATE {system} SET `weight` = $alWeight WHERE `name` = 'contact_field'";

    //drupal_set_message('Running query: '. $query); // add this if you want

    db_query($query);
  }
}

I will need to add similar code to my module so if my module is enabled after your module then it does the same check and ensures your module is run last.

OR you could just set update your module weight to 1 and then I wouldn't have to do anything. Simple. But that doesn't take into account changes other may make so while the first option is more complicated and maybe a bit over the top it will be more robust for the future.

function contact_field_enable() {
   
  if (module_exists('contact_forms')) {
    $query = "UPDATE {system} SET `weight` = 1 WHERE `name` = 'contact_field'";
    db_query($query);
  }
}

What do you think?

Regards
Geoff

beautifulmind’s picture

Hello Geoff,
Thanks for the update and the suggestion. I will make the required changes and will publish a stable release after Diwali.

Regards.

Steve -cc’s picture

Hi
Is there anything I can do to help move this forward?