Your software
My Mautic version is: 5.2.0 (upgraded vom 5.1.1)
My PHP version is: 8.1.30
My Database type and version is: MariaDB
Your problem
My problem is:
I edited an existing campaign decision “clicks email”. Tried to add a “Limit to urls contains” string. This results in “This form should not contain extra fields” errror after click on “Update”.
Don’t know if it worked before on 5.1.1, this is the first time, i wanted to use this feature.
These errors are showing in the log:
Only see some IMAP fetch error.
Steps I have tried to fix the problem:
created a new campaign, added a send email step and a decision “clicks email” with “url contains”. Same error.
Instead of Firefox I used Google Chrome. Same error.
found this:
PR: Fix "This form should not contain extra fields" error in campaign event form by matbcvo · Pull Request #14325 · mautic/mautic · GitHub
and
issue:
mautic:5.2
← matbcvo:issue-14319
opened 09:53PM - 03 Dec 24 UTC
<!-- ## Which branch should I use for my PR?
Assuming that:
a = current ma… jor release
b = current minor release
c = future major release
* a.x for any features and enhancements (e.g. 5.x)
* a.b for any bug fixes (e.g. 4.4, 5.1)
* c.x for any features, enhancements or bug fixes with backward compatibility breaking changes (e.g. 5.x) -->
| Q | A
| -------------------------------------- | ---
| Bug fix? (use the a.b branch) | 🟢
| New feature/enhancement? (use the a.x branch) | 🔴
| Deprecations? | 🔴
| BC breaks? (use the c.x branch) | 🔴
| Automated tests included? | 🔴
| Related user documentation PR URL | mautic/user-documentation#...
| Related developer documentation PR URL | mautic/developer-documentation-new#...
| Issue(s) addressed | Fixes #14319
<!--
Additionally (see https://contribute.mautic.org/contributing-to-mautic/developer/code/pull-requests#work-on-your-pull-request):
- Always add tests and ensure they pass.
- Bug fixes must be submitted against the lowest maintained branch where they apply
(lowest branches are regularly merged to upper ones so they get the fixes too.)
- Features and deprecations must be submitted against the "4.x" branch.
-->
## Description
This PR resolves the issue where adding a new decision in campaigns results in the error:
`This form should not contain extra fields.`
**Changes**
- Enabled the `allow_extra_fields` option in the `EventType` form configuration to allow additional fields during form submission.
This change aligns with Symfony's recommendation for handling dynamic form data.
From Symfony documentation: https://symfony.com/doc/5.x/reference/forms/types/form.html#allow-extra-fields
PR #13569 introduced new enhancement and modified the `EventType.php` file. While it's not certain, these changes might be related to the validation error observed in Mautic 5.2.
<!--
Please write a short README for your feature/bugfix. This will help people understand your PR and what it aims to do. If you are fixing a bug and if there is no linked issue already, please provide steps to reproduce the issue here.
-->
<!--
| Before | After
| -------------------------------------- | ---
| |
-->
---
### 📋 Steps to test this PR:
<!--
This part is crucial. Take the time to write very clear, annotated and step by step test instructions, because testers may not be developers.
-->
1. Open this PR on Gitpod or pull down for testing locally (see docs on testing PRs [here](https://contribute.mautic.org/contributing-to-mautic/tester))
2. Create a new segment/form
3. Create a new campaign
4. Open the campaign builder
5. Attempt to add any decision type (e.g., Device visit, Downloads asset, Visits a page, etc.).
<!--
If you have any deprecations and backwards compatibility breaks, list them here along with the new alternative.
-->
https://github.com/user-attachments/assets/7d8c04af-e315-4b27-86dc-6c980b286377