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

An error when an anonymous trying to submit a form with an email field and to merge with an existing contact. #94

Open
WaldemarOrobanche opened this issue Jun 25, 2020 · 0 comments

Comments

@WaldemarOrobanche
Copy link

Mautic: 2.16.0
Extended Fields: 2.15
PHP: 7.1.33

An error when an anonymous trying to submit a form with an email field and to merge with a contact.

It occurs inside the createLeadFromSubmit method of the Mautic\FormBundle\Model\SubmissionModel class because to access the repository of the lead uses the getRepository method directly from Doctrine\ORM\EntityManager class.

Steps to reproduce

  1. Create an extended custom field, for example: my_extended_field;
  2. Create a form with the email and the points fields and bind them to the custom fields of a contact, for example:
    Email: email
    Points: points
  3. Create a contact with filled an email only.
  4. Put your form to a website.
  5. Go to your website page with your form like an anonymous and try to submit the form.

image

  1. After form submission you will get en error.

The error log:

500 Internal Server Error - PHP Notice - Undefined index: my_extended_field

Symfony\Component\Debug\Exception\ContextErrorException
/app/bundles/LeadBundle/Deduplicate/ContactMerger.php:201 at
/app/bundles/LeadBundle/Deduplicate/ContactMerger.php:201 at Mautic\CoreBundle\ErrorHandler\ErrorHandler -> handleError ( '8', 'PHP Notice - Undefined index: my_extended_field', '/var/www/html/app/bundles/LeadBundle/Deduplicate/ContactMerger.php', '201', array('winner' => object(Lead), 'loser' => object(Lead), 'loserDate' => object(DateTime), 'winnerDate' => object(DateTime), 'newest' => object(Lead), 'oldest' => object(Lead), 'newestFields' => array('id' => '1431', 'title' => null, 'firstname' => null, 'lastname' => null, 'company' => null, 'position' => null, 'email' => null, 'mobile' => null, 'phone' => null, 'points' => '0', 'address1' => null, 'address2' => null, 'city' => null, 'state' => null, 'zipcode' => null, 'country' => null, 'preferred_locale' => null, 'timezone' => 'Europe/Paris', 'last_active' => '2020-06-25 13:21:55', 'attribution_date' => null, 'attribution' => null, 'my_extended_field' => '20'), 'oldestFields' => array('id' => '1430', 'title' => null, 'firstname' => null, 'lastname' => null, 'company' => null, 'position' => null, 'email' => '[email protected]', 'mobile' => null, 'phone' => null, 'points' => '0', 'address1' => null, 'address2' => null, 'city' => null, 'state' => null, 'zipcode' => null, 'country' => null, 'preferred_locale' => null, 'timezone' => null, 'last_active' => null, 'attribution_date' => null, 'attribution' => null), 'field' => 'my_extended_field', 'newValue' => '2020-06-25 13:21:55', 'fromValue' => 'empty', 'exception' => object(ValueNotMergeableException)) )
/app/bundles/LeadBundle/Deduplicate/ContactMerger.php:98 at Mautic\LeadBundle\Deduplicate\ContactMerger -> mergeFieldData ( object(Lead), object(Lead) )
/app/bundles/LeadBundle/Model/LegacyLeadModel.php:65 at Mautic\LeadBundle\Deduplicate\ContactMerger -> merge ( object(Lead), object(Lead) )
/app/bundles/LeadBundle/Model/LeadModel.php:2759 at Mautic\LeadBundle\Model\LegacyLeadModel -> mergeLeads ( object(Lead), object(Lead), true )
/app/bundles/FormBundle/Model/SubmissionModel.php:990 at Mautic\LeadBundle\Model\LeadModel -> mergeLeads ( object(Lead), object(Lead) )
/app/bundles/FormBundle/Model/SubmissionModel.php:403 at Mautic\FormBundle\Model\SubmissionModel -> createLeadFromSubmit ( object(Form), array('email' => '[email protected]', 'points' => '3344'),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant