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

Fix clone campaign with form source #7642

Merged
merged 1 commit into from Aug 17, 2019

Conversation

@kuzmany
Copy link
Member

@kuzmany kuzmany commented Jun 24, 2019

Please be sure you are submitting this against the staging branch.

Q A
Bug fix?
New feature?
Automated tests included?
Related user documentation PR URL
Related developer documentation PR URL
Issues addressed (#s or URLs) #7127
BC breaks?
Deprecations?

Description:

Clone campaing with form source return 500 error. This PR fixed it

Steps to reproduce

  1. Create a new campaign such as in the screenshot below

image

  1. Clone the campaign
  2. Save the clone

The campaign is saved but an error page is shown

image

Go back to the clone and see the campaign builder :

image

Log errors

[2019-01-12 14:36:24] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\UniqueConstraintViolationException: "An exception occurred while executing 'INSERT INTO campaign_form_xref (campaign_id, form_id) VALUES (?, ?)' with params [15, 10]:  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '15-10' for key 'PRIMARY'" at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 66 {"exception":"[object] (Doctrine\\DBAL\\Exception\\UniqueConstraintViolationException(code: 0): An exception occurred while executing 'INSERT INTO campaign_form_xref (campaign_id, form_id) VALUES (?, ?)' with params [15, 10]:\n\nSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '15-10' for key 'PRIMARY' at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:66, Doctrine\\DBAL\\Driver\\PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '15-10' for key 'PRIMARY' at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:107, PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '15-10' for key 'PRIMARY' at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:105)"} []

Steps to test this PR:

  1. Load up this PR
  2. Repeat all steps, and see If there is not error
@kuzmany kuzmany added this to the 2.16.0 milestone Jun 24, 2019
Copy link

@florentpetitjean florentpetitjean left a comment

working on Mautibox

Copy link
Contributor

@virgilwashere virgilwashere left a comment

Patch works in my environment (2.15.0) as well.

@npracht npracht added this to Ready to Commit (passed testing) in Mautic 2 Aug 15, 2019
Mautic 2 automation moved this from Ready to Commit (passed testing) to Ready to Test (first time) Aug 17, 2019
Woeler
Woeler approved these changes Aug 17, 2019
@Woeler Woeler merged commit ea50c86 into mautic:staging Aug 17, 2019
1 of 2 checks passed
Mautic 2 automation moved this from Ready to Test (first time) to Merged Aug 17, 2019
@Woeler Woeler removed this from the 2.16.0 milestone Sep 27, 2019
@Woeler Woeler added this to the 2.15.3 milestone Sep 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Mautic 2
  
Merged
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants