Steps to reproduce (requires CCK and Content Profile modules):
1. Create a custom content type
- In the content type settings, check the "Use this content type as a content profile for users" box in the "Content Profile" section
- Add a custom field called first_name
- In the "Content profile" sub-tab, check the "Use on Registration" box
2. In Constant Contact module settings, go to "Change Settings" tab. Under "Extra Field Mappings", enter "FirstName:field_first_name"
3. Log out and register as a new user. Enter a value for the First Name field.
4. Log into Constant Contact and find the newly-created contact. Instead of having the correct value for the First Name field, the value appears as the string 'Array'.
Problem:
See lines 500-501 of constant_contact_user() in constant_contact.module. The POST value assigned to the extra field mapping is not a string in this case, rather it is an array. To get the correct string in this case, you would need to get the CCK field value as $_POST['field_first_name'][0]['value'].
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | constant_contact-handle-cck-fields.patch | 1.58 KB | thebuckst0p |
Comments
Comment #1
justphp commentedThe module was never meant to work with CCK fields.
Please follow the instructions provided in the module if you want to use extra fields.
Comment #2
thebuckst0p commentedThis is very easily handled, see attached patch.
(Patch replaces tabs with spaces in the relevant snippet, and if:endif; with standard curly braces, per Drupal coding standards.)
Please review and commit, thank you!
Comment #3
thebuckst0p commentedComment #4
justphp commentedComment #5
nathaniel commentedThis wasn't implemented correctly.
$extra_fields[$fieldname] = $_POST[$field_mappings[$fieldname]];needs to be above the CCK array check.Comment #6
nathaniel commentedComment #7
justphp commented