How to Recover after updating to webform_civiCRM 6.x-2.4 when your Drupal 6 site uses civiCRM 3.x
Are you using Drupal 6's webform module with CiviCRM version 3.x? Did you install the webform_civiCRM-6.x-2.4 module, and your site stopped creating civiCRM contact links for your webform reports?
First: re-set your site to use webform_civiCRM-6.x-2.3 and re-create the auto-assignment of civiCRM groups for each webform.
Next, if any webform submissions were created before you realized the problem and re-set your site as described above, follow the below steps to re-create links for those submissions.
- Backup EVERYTHING on your Production site.
- Test first using a Development site (not your Production site).
- Download data from the following Drupal table: webform_submitted_data. EXAMPLE DATA:
- nid=1082 for webformTitle (reference only, won't actually use this aside from intial filter of which contacts need created, you can discover which webform a node id corresponds to in the webform_civicrm_forms table).
- sid=submissionID
- cid=fieldID (examples from my webform_component table: 3=fname, 4=lname)
- data = actual text values for field cid chosen
- Using data gathered in step 3, create contacts in civicrm_contact table.
- This table auto-increments.
- EXAMPLE for MySQL via the phpmyadmin interface: INSERT INTO `civicrm_contact` (`contact_type`, `contact_sub_type`, `sort_name`, `display_name`, `source`, `first_name`, `last_name`,`preferred_language`) VALUES ('Individual','DefaultGroupName','Last, First','First Last','Webform Title','First','Last','en_US'), ('Individual','DefaultGroupName','Last, First','First Last','Webform Title','First','Last','en_US');
- TIP: to easily create multiple lines of MySQL INSERTS code, I use Excel or OpenOffice's Calc to do some quick concatenation into the correct format.
- Download contact ids created in step 4, and match them with their submission id from step 3, based on matching first and last name fields.
- Add data from step 5 into the webform_civicrm_submissions Drupal table (which finally re-links civiCRM & Drupal tracking of these contacts in relation to their webform submissions).
- EXAMPLE for MySQL via the phpmyadmin interface: INSERT INTO `webform_civicrm_submissions` (`sid`, `contact_id`, `activity_id`) VALUES (1484, '-102-', 0), (1485, '-103-', 0);
- If you created special civiCRM groups that contacts should go into
for different webforms, you will also need to add the contact ids from
step 4 into the civicrm_group_contact table with the appropriate civiCRM group (or you can do this manually through User Interface)
- EXAMPLE for MySQL via the phpmyadmin interface: INSERT INTO `civicrm_group_contact` (`group_id`, `contact_id`, `status`) VALUES (4, 102, 'Added'), (4, 103, 'Added');
- Once this works in your Development site, back up your Production site AGAIN, set site to Maintenance mode, and follow the exact same steps as you did before.
Comments
Coleman Watts
Whoops
Didn't mean to cause so much trouble with the new release, just trying to keep up support for the latest CiviCRM codebase (which has some differences to 3.4 thus the incompatibility).
Everything here also applies to the 7.x branch.
NB: A potentially easier solution is to upgrade Civi to 4.1, and the webform integration module will once again be compatible :)
Adelle Frank
No worries! Need more Drupal updates status options
I know, I just wish there were more states to choose from for updates to modules than security or other.