3

I'm using X-cart 5 and trying to create a new form following this tutorial from X-cart's website. I have successfully created the form and it is displayed correctly. However, if I specify field type that is not X-cart's (for instance if I use Symfony\Component\Form\Extension\Core\Type\PasswordType), the field is emptied on blur.

Sample code generating the form, in which email and passwords have the issue I described, while the sample field is working correctly:

 protected function defineFields()
{

    $schema = [
        self::SECTION_DEFAULT => [
            'email'         => [
                'label'       => static::t('E-mail'),
                'required'    => true,
                'type'        => 'Symfony\Component\Form\Extension\Core\Type\EmailType',
                'position'    => 100
            ],
            'password'         => [
                'label'       => static::t('Password'),
                'type'        => 'Symfony\Component\Form\Extension\Core\Type\PasswordType',
                'required'    => true,
                'position'    => 100,
            ],
            'password_conf'         => [
                'label'       => static::t('Confirm password'),
                'type'        => 'Symfony\Component\Form\Extension\Core\Type\PasswordType',
                'required'    => true,
                'position'    => 100
            ],
            'sampleField'         => [
                'label'       => static::t('Sample field'),
                'type'        => 'XLite\View\FormModel\Type\TextareaAdvancedType',
                'position'    => 100
            ]
        ]
    ];

    return $schema;
}

Do you have any ideas why this happens?

Thanks!

user
  • 31
  • 2

0 Answers0