Post data to mautic form 500 response

After we upgraded our self hosted version of Mautic (to the latest 2.2.0) we encounter a problem when posting form data directly to our Mautic instance.

We have a form defined with emailaddress and company name, and post data via Python:

data = {‘mauticform[company_name]’: ‘Test’, ‘mauticform[formId]’: 18, ‘mauticform[partner_email]’: ‘florus+test2@{custom_domain}.nl’}

requests.post(‘https://{custom_mautic_domain}/form/submit’, data=data)



Response is 500.



And here are the last lines of the log file (after posting):

[2016-10-17 11:33:13] mautic.ERROR: Deprecation: The alias option of the form.type_extension tag of service “fos_rest.form.extension.csrf_disable” is deprecated since version 2.8 and will be removed in 3.0. Use the extended_type option instead. - in file /opt/bitnami/apps/mautic/htdocs/vendor/symfony/framework-bundle/DependencyInjection/Compiler/FormPass.php - at line 67 [] []

[2016-10-17 09:38:12] mautic.NOTICE: PHP Notice: Array to string conversion - in file /opt/bitnami/apps/mautic/htdocs/app/bundles/CoreBundle/Helper/InputHelper.php - at line 309 [] []

[2016-10-17 09:38:12] mautic.CRITICAL: Uncaught PHP Exception DoctrineORMORMInvalidArgumentException: “A new entity was found through the relationship ‘MauticFormBundleEntitySubmission#lead’ that was not configured to cascade persist operations for entity: MauticLeadBundleEntityLead with ID #1131. To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity or configure cascade persist this association in the mapping for example @ManyToOne(…,cascade={“persist”}).” at /opt/bitnami/apps/mautic/htdocs/vendor/doctrine/orm/lib/Doctrine/ORM/ORMInvalidArgumentException.php line 92 {“exception”:"[object] (Doctrine\ORM\ORMInvalidArgumentException(code: 0): A new entity was found through the relationship ‘Mautic\FormBundle\Entity\Submission#lead’ that was not configured to cascade persist operations for entity: Mautic\LeadBundle\Entity\Lead with ID #1131. To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity or configure cascade persist this association in the mapping for example @ManyToOne(…,cascade={“persist”}). at /opt/bitnami/apps/mautic/htdocs/vendor/doctrine/orm/lib/Doctrine/ORM/ORMInvalidArgumentException.php:92)"} []

[2016-10-17 09:38:12] mautic.ERROR: Deprecation: The SymfonyComponentTranslationTranslator::getMessages method is deprecated since version 2.8 and will be removed in 3.0. Use TranslatorBagInterface::getCatalogue() method instead. - in file /opt/bitnami/apps/mautic/htdocs/vendor/symfony/translation/Translator.php - at line 275 [] []



Hope anyone can point us in the right direction.



Thanks a lot!

After we upgraded our self hosted version of Mautic (to the latest 2.2.0) we encounter a problem when posting form data directly to our Mautic instance.
We have a form defined with emailaddress and company name, and post data via Python:
data = {‘mauticform[company_name]’: ‘Test’, ‘mauticform[formId]’: 18, ‘mauticform[partner_email]’: ‘florus+test2@{custom_domain}.nl’}
requests.post(‘https://{custom_mautic_domain}/form/submit’, data=data)

Response is 500.

And here are the last lines of the log file (after posting):
[2016-10-17 11:33:13] mautic.ERROR: Deprecation: The alias option of the form.type_extension tag of service “fos_rest.form.extension.csrf_disable” is deprecated since version 2.8 and will be removed in 3.0. Use the extended_type option instead. - in file /opt/bitnami/apps/mautic/htdocs/vendor/symfony/framework-bundle/DependencyInjection/Compiler/FormPass.php - at line 67 [] []
[2016-10-17 09:38:12] mautic.NOTICE: PHP Notice: Array to string conversion - in file /opt/bitnami/apps/mautic/htdocs/app/bundles/CoreBundle/Helper/InputHelper.php - at line 309 [] []
[2016-10-17 09:38:12] mautic.CRITICAL: Uncaught PHP Exception DoctrineORMORMInvalidArgumentException: “A new entity was found through the relationship ‘MauticFormBundleEntitySubmission#lead’ that was not configured to cascade persist operations for entity: MauticLeadBundleEntityLead with ID #1131. To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity or configure cascade persist this association in the mapping for example @ManyToOne(…,cascade={“persist”}).” at /opt/bitnami/apps/mautic/htdocs/vendor/doctrine/orm/lib/Doctrine/ORM/ORMInvalidArgumentException.php line 92 {“exception”:"[object] (Doctrine\ORM\ORMInvalidArgumentException(code: 0): A new entity was found through the relationship ‘Mautic\FormBundle\Entity\Submission#lead’ that was not configured to cascade persist operations for entity: Mautic\LeadBundle\Entity\Lead with ID #1131. To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity or configure cascade persist this association in the mapping for example @ManyToOne(…,cascade={“persist”}). at /opt/bitnami/apps/mautic/htdocs/vendor/doctrine/orm/lib/Doctrine/ORM/ORMInvalidArgumentException.php:92)"} []
[2016-10-17 09:38:12] mautic.ERROR: Deprecation: The SymfonyComponentTranslationTranslator::getMessages method is deprecated since version 2.8 and will be removed in 3.0. Use TranslatorBagInterface::getCatalogue() method instead. - in file /opt/bitnami/apps/mautic/htdocs/vendor/symfony/translation/Translator.php - at line 275 [] []

Hope anyone can point us in the right direction.

Thanks a lot!

Couple of observations: firstly the latest version is 2.2.1, which version do you have? Were there any errors during the installation?

Secondly, the timestamp on that first error is a couple of hours later than all the warnings, so I reckon your problem is to be found there. At a guess I’d say that file hasn’t been updated while others have, but you could take a look at line 67 and see if there’s something you can change like it says (but that may just lead to a different error further down the line)