Jump to content

Key "label_attr" issue when using SubmitType in FormBuilder


herrnesto

Recommended Posts

Hello, I have a problem with the form builder. I use the form in the code below, but as soon as I add the submit button, I face an error. When i remove the button the form works fine. What could cause this issue?

This is the error:

Quote

Key "label_attr" for array with keys "value, attr, form, id, name, full_name, disabled, label, label_format, multipart, block_prefixes, unique_block_prefix, translation_domain, cache_key, clicked" does not exist in "@PrestaShop/Admin/macros.html.twig".

 

And this is the form:

<?php

namespace Xyz\Members\Forms;

use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;

class MemberType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('email', TextType::class, [
                'attr' => [
                    'placeholder' => "The E-Mail"
                ]
            ])
            ->add('member_code', TextType::class, [
                'attr' => [
                    'placeholder' => "The Member Code"
                ]
            ])
            ->add('active', ChoiceType::class, [
                'choices' => [
                    'Aktiv' => 1,
                    'Inaktiv' => 0,
                ],
            ])
            ->add('expiration_date', DateType::class, [
                'attr' => [
                    'placeholder' => "expiration_date"
                ]
            ])
            ->add('send', SubmitType::class);

        parent::buildForm($builder, $options); // TODO: Change the autogenerated stub
    }
}

I use PrestaShop 1.7.8.2

Edited by herrnesto
added more infos (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...