Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(BUG) Form field value is not mapped to (extended) custom field in existing contact profile #53

Open
albanleandri opened this issue Jul 17, 2018 · 2 comments
Labels

Comments

@albanleandri
Copy link

albanleandri commented Jul 17, 2018

Description : The functionality to map a form value to an extended custom field is broken when the contact already exists in Mautic. It's a problem for migrating an existing system's custom contact field to extended contact fields.

Mautic : v2.12.2
PHP : PHP Version 7.0.27

  1. Set as follows

image

  1. Create 2 custom fields : 1 normal / 1 extended (I haven't tried secure extended)

image

  1. Create a form with 2 text fields, and map the value of each to the previously created contact & extended custom fields

image

  1. Submit the form with a value in each field (and use the email of an existing contact whose profile already exists in Mautic)

image

  1. Observe the form results (it should be as expected)

image

  1. Check contact profile

image

LOG : It seems (without certainty) that the following log errors relates to this issue:

[2018-07-17 04:46:41] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\InvalidFieldNameException: "An exception occurred while executing 'SELECT DISTINCT f.title AS title FROM lead_fields l WHERE (f.title <> '') AND (f.title IS NOT NULL) ORDER BY title ASC LIMIT 10 OFFSET 0': SQLSTATE[42S22]: Column not found: 1054 Unknown column 'f.title' in 'field list'" at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 71 {"exception":"[object] (Doctrine\DBAL\Exception\InvalidFieldNameException(code: 0): An exception occurred while executing 'SELECT DISTINCT f.title AS title FROM lead_fields l WHERE (f.title <> '') AND (f.title IS NOT NULL) ORDER BY title ASC LIMIT 10 OFFSET 0':\n\nSQLSTATE[42S22]: Column not found: 1054 Unknown column 'f.title' in 'field list' at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:71, Doctrine\DBAL\Driver\PDOException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'f.title' in 'field list' at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:106, PDOException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'f.title' in 'field list' at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:104)"} []

Note : If you use in the form the email of a new contact (never added to Mautic before), then it will create this contact and the mapping will work well.

image

@albanleandri
Copy link
Author

albanleandri commented Aug 7, 2018

Hi @heathdutton I have been able to replicate this on 2.14.
I am using a form and I try to map some text field value to a custom field with object type "extended" and type "text", but the value of my extended custom field remain empty, as described above.
The issue is only for updating existing contacts, not for a newly created contact (new email passed in the form).

@scottshipman
Copy link
Contributor

I pushed a fix today that addresses the "select DISTINCT f.title..." error. Does this also fix this issue for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants