# Form Actions do not trigger

**URL:** <https://forum.mautic.org/t/form-actions-do-not-trigger/6153>\
**Category:** Product Support\
**Created:** [October 9, 2016, 8:40am UTC](https://forum.mautic.org/t/form-actions-do-not-trigger/6153 "2016-10-09T08:40:00Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![petertl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/petertl/32/511_2.png) [@petertl](https://forum.mautic.org/u/petertl)\
**Post date:** [October 9, 2016, 8:40am UTC](https://forum.mautic.org/t/form-actions-do-not-trigger/6153/1 "2016-10-09T08:40:00Z")

</div>

Hi,  
  
  
  
I have a vanilla and blank installation of the latest Mautic software. I configured email settings properly (tested it) and created a lead form which I embedded on a Wordpress page. The lead form actions should tag the lead and send the form results to an email address.  
  
  
  
When I display the form on the Wordpress page, fill it out and submit, the following happens:

1. The submit button remains at “Please wait…”  
2. The lead is created according to the field values  
3. The lead is **not** tagged  
4. The lead form results are **not** sent to the email address  
  
  
  
It seems that the lead creation works fine, but the form actions are not triggered. Somehow the form “hangs”, this is what the “Please wait…” indicates. I tested again in the form preview - same (negative) result.  
  
  
  
Any ideas on how to debug this? Ich checked the log and the only maybe relevant error I can find is:

Code:

[2016-10-09 09:27:54] 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 #11. 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 /.../mautic/vendor/doctrine/orm/lib/Doctrine/ORM/ORMInvalidArgumentException.php line 92

  
Any help is highly appreciated.  
  
Peter

---

<div class="post-metadata">

**Author:** ![petertl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/petertl/32/511_2.png) [@petertl](https://forum.mautic.org/u/petertl)\
**Post date:** [October 9, 2016, 8:40am UTC](https://forum.mautic.org/t/form-actions-do-not-trigger/6153/2 "2016-10-09T08:40:00Z")

</div>

Hi,

I have a vanilla and blank installation of the latest Mautic software. I configured email settings properly (tested it) and created a lead form which I embedded on a Wordpress page. The lead form actions should tag the lead and send the form results to an email address.

When I display the form on the Wordpress page, fill it out and submit, the following happens:

1. The submit button remains at “Please wait…”
2. The lead is created according to the field values
3. The lead is not tagged
4. The lead form results are not sent to the email address

It seems that the lead creation works fine, but the form actions are not triggered. Somehow the form “hangs”, this is what the “Please wait…” indicates. I tested again in the form preview - same (negative) result.

Any ideas on how to debug this? Ich checked the log and the only maybe relevant error I can find is:

```auto
[2016-10-09 09:27:54] 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 #11. 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 /.../mautic/vendor/doctrine/orm/lib/Doctrine/ORM/ORMInvalidArgumentException.php line 92
```

Any help is highly appreciated.

Peter

---

<div class="post-metadata">

**Author:** ![petertl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/petertl/32/511_2.png) [@petertl](https://forum.mautic.org/u/petertl)\
**Post date:** [October 9, 2016, 9:06am UTC](https://forum.mautic.org/t/form-actions-do-not-trigger/6153/3 "2016-10-09T09:06:21Z")

</div>

Update:

- Clearing the cache did not change anything
- Campaign email work as expected
- I did not finde anything in the Apache-Log

---

<div class="post-metadata">

**Author:** ![andreipop](https://avatars.discourse-cdn.com/v4/letter/a/ed655f/32.png) [@andreipop](https://forum.mautic.org/u/andreipop)\
**Post date:** [October 10, 2016, 11:11am UTC](https://forum.mautic.org/t/form-actions-do-not-trigger/6153/4 "2016-10-10T11:11:21Z")

</div>

I have the same problem. I think I did a quick & dirty? fix for this, in app/bundles/FormBundle/Entity/Submission.php, line #83 in function loadMetadata, add “-\>cascadePersist()”, so the call should look something like this:

`builder->createManyToOne('form', 'Form')
            ->cascadePersist()
            ->inversedBy('submissions')
            ->addJoinColumn('form_id', 'id', false, false, 'CASCADE')
            ->build();`

This error only happens on first submit (like if I clear all the cookies and then reload/submit), the second time I arrive on the page the form works because the entity was probably created before in the database.

---

<div class="post-metadata">

**Author:** ![petertl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/petertl/32/511_2.png) [@petertl](https://forum.mautic.org/u/petertl)\
**Post date:** [October 10, 2016, 12:00pm UTC](https://forum.mautic.org/t/form-actions-do-not-trigger/6153/5 "2016-10-10T12:00:33Z")

</div>

I changed the code as you suggested - unfortunately the behaviour is the same. And on my instance the error happens all the time, not depending on if the submission is the first or the second one.

---

<div class="post-metadata">

**Author:** ![tsympov](https://avatars.discourse-cdn.com/v4/letter/t/e79b87/32.png) [@tsympov](https://forum.mautic.org/u/tsympov)\
**Post date:** [October 10, 2016, 12:07pm UTC](https://forum.mautic.org/t/form-actions-do-not-trigger/6153/6 "2016-10-10T12:07:29Z")

</div>

I’ve got the same issue, tried fixing like andreipop suggested, but no luck…

---

<div class="post-metadata">

**Author:** ![petertl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/petertl/32/511_2.png) [@petertl](https://forum.mautic.org/u/petertl)\
**Post date:** [October 12, 2016, 11:39am UTC](https://forum.mautic.org/t/form-actions-do-not-trigger/6153/7 "2016-10-12T11:39:12Z")

</div>

Sorry, but I have to push this issue. I installed Mautic as addition for a production environment. I received several feedback emails that users think, the registration did not work.

Thank you,  
Peter

---

<div class="post-metadata">

**Author:** ![justinroffmarsh](https://avatars.discourse-cdn.com/v4/letter/j/d07c76/32.png) [@justinroffmarsh](https://forum.mautic.org/u/justinroffmarsh)\
**Post date:** [October 12, 2016, 10:03pm UTC](https://forum.mautic.org/t/form-actions-do-not-trigger/6153/8 "2016-10-12T22:03:24Z")

</div>

The same issue is also reported here: [https://www.mautic.org/community/index.php/5779-2-2-0-form-submissions-hanging/0#p16294](https://www.mautic.org/community/index.php/5779-2-2-0-form-submissions-hanging/0#p16294)

---

<div class="post-metadata">

**Author:** ![Tony\_Gavin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/tony_gavin/32/2440_2.png) [@Tony\_Gavin](https://forum.mautic.org/u/Tony_Gavin)\
**Post date:** [October 13, 2016, 12:14am UTC](https://forum.mautic.org/t/form-actions-do-not-trigger/6153/9 "2016-10-13T00:14:26Z")

</div>

This fixed it [https://github.com/mautic/mautic/pull/2669](https://github.com/mautic/mautic/pull/2669)

---

<div class="post-metadata">

**Author:** ![tsympov](https://avatars.discourse-cdn.com/v4/letter/t/e79b87/32.png) [@tsympov](https://forum.mautic.org/u/tsympov)\
**Post date:** [October 14, 2016, 7:49am UTC](https://forum.mautic.org/t/form-actions-do-not-trigger/6153/10 "2016-10-14T07:49:04Z")

</div>

Indeed, it’s fixed. Thanks, Tony

---

<div class="post-metadata">

**Author:** ![nitesh](https://avatars.discourse-cdn.com/v4/letter/n/8491ac/32.png) [@nitesh](https://forum.mautic.org/u/nitesh)\
**Post date:** [May 10, 2017, 5:29pm UTC](https://forum.mautic.org/t/form-actions-do-not-trigger/6153/11 "2017-05-10T17:29:49Z")

</div>

I am having same issue after upgrading to v2.8.1 Any ideas?

---

<div class="post-metadata">

**Author:** ![ffmarketing](https://avatars.discourse-cdn.com/v4/letter/f/ecae2f/32.png) [@ffmarketing](https://forum.mautic.org/u/ffmarketing)\
**Post date:** [July 20, 2017, 1:55am UTC](https://forum.mautic.org/t/form-actions-do-not-trigger/6153/12 "2017-07-20T01:55:53Z")

</div>

Having same issue after installing a fresh copy of 2.9.0. Ideas or any progress here?

---

<div class="post-metadata">

**Author:** ![darren2017](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@darren2017](https://forum.mautic.org/u/darren2017)\
**Post date:** [July 20, 2017, 12:09pm UTC](https://forum.mautic.org/t/form-actions-do-not-trigger/6153/13 "2017-07-20T12:09:27Z")

</div>

I have the same problem on a brand new Installation. I’m running Nginx/PHP7.0. The forms are submitted and the Contact added but the Redirect doesn’t happen.

---

<div class="post-metadata">

**Author:** ![yalcin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/yalcin/32/29_2.png) [@yalcin](https://forum.mautic.org/u/yalcin)\
**Post date:** [July 25, 2017, 4:31am UTC](https://forum.mautic.org/t/form-actions-do-not-trigger/6153/14 "2017-07-25T04:31:45Z")

</div>

In 2.9.0, this happens when you are logged into Mautic.  
Use incognito browser for testing.

---

<div class="post-metadata">

**Author:** ![theniel](https://avatars.discourse-cdn.com/v4/letter/t/0ea827/32.png) [@theniel](https://forum.mautic.org/u/theniel)\
**Post date:** [July 28, 2017, 7:45am UTC](https://forum.mautic.org/t/form-actions-do-not-trigger/6153/15 "2017-07-28T07:45:53Z")

</div>

[quote=24568:@yalcin]In 2.9.0, this happens when you are logged into Mautic.  
Use incognito browser for testing.[/quote]  
That works in my case! Thank you!

---

<div class="post-metadata">

**Author:** ![phuquy1311](https://avatars.discourse-cdn.com/v4/letter/p/a698b9/32.png) [@phuquy1311](https://forum.mautic.org/u/phuquy1311)\
**Post date:** [July 29, 2017, 12:32am UTC](https://forum.mautic.org/t/form-actions-do-not-trigger/6153/16 "2017-07-29T00:32:51Z")

</div>

I’m getting the same log error and the form is hang on submit button after hit submit. Here is the log:

```auto
[2017-07-29 00:24:05] mautic.CRITICAL: Uncaught PHP Exception DoctrineORMORMInvalidArgumentException: "A new entity was found through the relationship 'MauticEmailBundleEntityStatDevice#stat' that was not configured to cascade persist operations for entity: MauticEmailBundleEntityStat@0000000052ca741c00000000025c21fc. 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"}). If you cannot find out which entity causes the problem implement 'MauticEmailBundleEntityStat#__toString()' to get a clue." at /home/go.firetoeic.com/public_html/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\EmailBundle\Entity\StatDevice#stat' that was not configured to cascade persist operations for entity: Mautic\EmailBundle\Entity\Stat@0000000052ca741c00000000025c21fc. 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"}). If you cannot find out which entity causes the problem implement 'Mautic\EmailBundle\Entity\Stat#__toString()' to get a clue. at /home/go.firetoeic.com/public_html/vendor/doctrine/orm/lib/Doctrine/ORM/ORMInvalidArgumentException.php:92)"} []
```

you can test the form here: [https://go.firetoeic.com/form/20](https://go.firetoeic.com/form/20)
