# Mautic 4 Speichern von Formularen kommt ERROR 500

**URL:** <https://forum.mautic.org/t/mautic-4-speichern-von-formularen-kommt-error-500/20901>\
**Category:** Mautic 4 Install/Upgrade Support\
**Created:** [September 16, 2021, 2:20pm UTC](https://forum.mautic.org/t/mautic-4-speichern-von-formularen-kommt-error-500/20901 "2021-09-16T14:20:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ips](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ips/32/716_2.png) [@ips](https://forum.mautic.org/u/ips)\
**Post date:** [September 16, 2021, 2:20pm UTC](https://forum.mautic.org/t/mautic-4-speichern-von-formularen-kommt-error-500/20901/1 "2021-09-16T14:20:52Z")

</div>

**Mautic 4**  
_My PHP version is 7.4_ :  
_My MySQL/MariaDB version is_ (delete as applicable): MySQL/MariaDB version

**Updating/Installing Errors**  
_I am_ (delete as applicable): Updating  
_Upgrading/installing via_ (delete as applicable) : Web / Command Line

_These errors are showing in the installer_ :

_These errors are showing in the Mautic log_ :  
[2021-09-16 13:45:51] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Form\Exception\UnexpectedTypeException: “Expected argument of type “null or string”, “boolean” given” at /html/mautic\_xy/vendor/symfony/form/Extension/Core/DataMapper/RadioListMapper.php line 49 {“exception”:"[object] (Symfony\Component\Form\Exception\UnexpectedTypeException(code: 0): Expected argument of type “null or string”, “boolean” given at /html/mautic\_xy/vendor/symfony/form/Extension/Core/DataMapper/RadioListMapper.php:49)"}

Die Datei RadioListMapper hab ich im Anhang beigelegt.

```auto
`<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Form\Extension\Core\DataMapper;

use Symfony\Component\Form\DataMapperInterface;
use Symfony\Component\Form\Exception\UnexpectedTypeException;

/**
 * Maps choices to/from radio forms.
 *
 * A {@link ChoiceListInterface} implementation is used to find the
 * corresponding string values for the choices. The radio form whose "value"
 * option corresponds to the selected value is marked as selected.
 *
 * @author Bernhard Schussek <bschussek@gmail.com>
 */
class RadioListMapper implements DataMapperInterface
{
    /**
     * {@inheritdoc}
     */
    public function mapDataToForms($choice, $radios)
    {
        if (!\is_string($choice)) {
            throw new UnexpectedTypeException($choice, 'string');
        }

        foreach ($radios as $radio) {
            $value = $radio->getConfig()->getOption('value');
            $radio->setData($choice === $value);
        }
    }

    /**
     * {@inheritdoc}
     */
    public function mapFormsToData($radios, &$choice)
    {
        if (null !== $choice && !\is_string($choice)) {
            throw new UnexpectedTypeException($choice, 'null or string');
        }

        $choice = null;

        foreach ($radios as $radio) {
            if ($radio->getData()) {
                if ('placeholder' === $radio->getName()) {
                    return;
                }

                $choice = $radio->getConfig()->getOption('value');

                return;
            }
        }
    }
}
`

```

**Your problem**  
_My problem is_ :  
Beim Anlegen und Speichern eines Formulars kommt ERROR 500

_Steps I have tried to fix the problem_ :

---

<div class="post-metadata">

**Author:** ![alexanderloewe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/alexanderloewe/32/637_2.png) [@alexanderloewe](https://forum.mautic.org/u/alexanderloewe)\
**Post date:** [September 16, 2021, 6:51pm UTC](https://forum.mautic.org/t/mautic-4-speichern-von-formularen-kommt-error-500/20901/2 "2021-09-16T18:51:58Z")

</div>

Das Problem hatte ich letztens auch, habe bisher aber noch keine Lösung.

---

<div class="post-metadata">

**Author:** ![ips](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ips/32/716_2.png) [@ips](https://forum.mautic.org/u/ips)\
**Post date:** [September 17, 2021, 1:05pm UTC](https://forum.mautic.org/t/mautic-4-speichern-von-formularen-kommt-error-500/20901/3 "2021-09-17T13:05:07Z")

</div>

Ich denke, daß es an dem Problem hier liegt:

 ![Unbenannt-1](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/4/4ee399642e2df3fd1b1855451b32ea5adb34df56.jpeg)

Sobald ich den Rendering-Stil auf NEIN stelle und dann abspeichere, kommt die Fehlermeldung ERROR 500

Zum Testen hab ich ein Formular mit Renderig-Stil JA angelegt, da funktioniert es.

Nun will ich aber mein eigenes CSS nutzen, und darum Rendering-Stil NEIN.

Wer kann helfen?

---

<div class="post-metadata">

**Author:** ![sfahrenkrog1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/sfahrenkrog1/32/4583_2.png) [@sfahrenkrog1](https://forum.mautic.org/u/sfahrenkrog1)\
**Post date:** [January 7, 2022, 12:52pm UTC](https://forum.mautic.org/t/mautic-4-speichern-von-formularen-kommt-error-500/20901/4 "2022-01-07T12:52:44Z")

</div>

Das ist ein Bug der gemeldet wurde und bereits behoben wurde.

Hier ist der Patch:

> <https://github.com/mautic/mautic/pull/10673>
>
> | 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 | ❌  
> | Related developer documentation PR URL |  
> | Issue(s) addressed | Fixes #10453   
> 
> \### How can we reproduce this issue?
> 
> 1. Go to forms
> 2. Create a new Form
> 3. Deactivate "Render Style from Template"
> 4. Save the form
> 
> Bonus:(If it seemed to have saved errorless, open the form, activate, save and then deactivate the "Render Style from Template again and see wether you get an error or not")
> 
> Testing on my local, I removed that line, and everything worked fine.
> 
> \<a href="https://gitpod.io/#https://github.com/mautic/mautic/pull/10673"\>\<img src="https://gitpod.io/button/open-in-gitpod.svg"/\>\</a\>

Kann man einspielen mit dem Befehl:

curl -L [https://patch-diff.githubusercontent.com/raw/mautic/mautic/pull/10673.diff](https://patch-diff.githubusercontent.com/raw/mautic/mautic/pull/10673.diff) | git apply -v --exclude=\*Test.php

(im Mautic Document Root auf der Shell)

Bugfix ist sonst auch in der Version 4.1.1 drin, wenn Sie kommt.
