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

Entry Integration not firing on when form is submitted #1970

Open
bfjare opened this issue Jul 5, 2024 · 5 comments
Open

Entry Integration not firing on when form is submitted #1970

bfjare opened this issue Jul 5, 2024 · 5 comments

Comments

@bfjare
Copy link

bfjare commented Jul 5, 2024

Describe the bug

I have a form that creates and updates entry. If I submit the form it doesn't create or update the entry, but if i trigger the integration in the control panel under the submission it works fine in both cases.

Steps to reproduce

  1. Create form that has an entry integration.
  2. Map fields.
  3. Submit form on client side.

Form settings

  • Multi-page form: No
  • Submission Method: Page Reload
  • Client-side Validation: Yes
  • Custom Form Templates: No

Craft CMS version

5.2.5

Plugin version

3.0.0-beta.16

Multi-site?

No

Additional context

No response

@engram-design
Copy link
Member

So the difference between triggering the integration manually and normal submission is that the latter uses the Queue by default. How does your Queue run? Are there any jobs in the queue after you fill in the form?

@bfjare
Copy link
Author

bfjare commented Jul 6, 2024

I'm running locally in ddev but when I refresh the control panel I do see a queue run to update search indexes but that's it.

@bfjare
Copy link
Author

bfjare commented Jul 6, 2024

Screenshot 2024-07-06 at 11 25 08 AM
Screenshot 2024-07-06 at 11 25 17 AM
Screenshot 2024-07-06 at 11 25 28 AM

@bfjare
Copy link
Author

bfjare commented Jul 6, 2024

Sorry, I explained the issue slightly incorrectly. It does create the entry on the first submission but updating it doesn't do anything. It doesn't create a new entry and it also doesn't update the current entry.

The form is being loaded in the template like this.

{% set submission = craft.formie.submissions.form('submitBusinessInformation').email(currentUser.email).one() %}
{% if submission|length %}
    {% do submission.form.setSubmission(submission) %}
    {{ craft.formie.renderForm(submission.form) }}
{% else %}
    {{ craft.formie.renderForm('submitBusinessInformation') }}
{% endif %}

@engram-design
Copy link
Member

So I will mention that if you're editing a completed submission, that's not going to trigger integrations or emails when the form is updated. I think that might be what's going on here, as the {% do submission.form.setSubmission(submission) %} call is setting the form to essentially be in "edit" mode.

Generally, we only want emails and integrations to run when you submit the form for the first time.

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

No branches or pull requests

2 participants