wpbrasil / odin

Framework and base theme for development with WordPress.
http://wpod.in
565 stars 195 forks source link

PHP Warning: Illegal offset type in class-contact-form.php on line 95 #406

Closed matheusilario closed 8 years ago

matheusilario commented 8 years ago

Boa noite pessoal estou quebrando cabeça aqui para solucionar um problema. Criei um formulário e quando estou tentando enviar não recebo os e-mails. Vi na issue #390 sobre a utilização do array para label. Já tentei com e sem array, mas apenas quando comento a label funciona.

Obrigado desde já.

Segue os campos:

$form->set_fields(
        array(
            array(
                'fields' => array(
                    array(
                        'id'          => 'nome', // Obrigatório
                        'label' => array(
                            'text'  => __( 'Seu nome', 'odin' ) // Obrigatório
                        ),
                        'type'        => 'text', // Obrigatório
                        'required'    => true, // Campo obrigatório (true/false) Opcional
                        'attributes'  => array( // Opcional (atributos para input HTML/HTML5)
                            'placeholder' => __( 'Seu nome' )
                        ),
                    ),
                    array(
                        'id'          => 'email', // Obrigatório
                        'label'       => array(
                            'text'  => __( 'E-mail', 'odin' ) // Obrigatório
                        ),
                        'type'        => 'email', // Obrigatório
                        'required'    => true, // Campo obrigatório (true/false) Opcional
                        'attributes'  => array( // Opcional (atributos para input HTML/HTML5)
                            'placeholder' => __( 'Seu e-mail!' )
                        ),
                    ),
                    array(
                        'id'          => 'telefone', // Obrigatório
                        'label'       => array(
                            'text'  => __( 'Telefone', 'odin' ) // Obrigatório
                        ),
                        'type'        => 'text', // Obrigatório
                        //'required'    => true, // Campo obrigatório (true/false) Opcional
                        'attributes'  => array( // Opcional (atributos para input HTML/HTML5)
                            'placeholder' => __( 'Telefone para contato!' )
                        ),
                    ),
                    array(
                        'id'          => 'cep', // Obrigatório
                        'label'       => array(
                            'text'  => __( 'CEP', 'odin' ) // Obrigatório
                        ),
                        'type'        => 'text', // Obrigatório
                        'required'    => true, // Campo obrigatório (true/false) Opcional
                        'attributes'  => array( // Opcional (atributos para input HTML/HTML5)
                            'placeholder' => __( 'CEP!' )
                        ),
                    ),
                    array(
                        'id'          => 'observacao', // Obrigatório
                        'label'       => array(
                            'text'  => __( 'Observações', 'odin' ) // Obrigatório
                        ),
                        'type'        => 'textarea', // Obrigatório
                        'required'    => true, // Campo obrigatório (true/false) Opcional
                        'attributes'  => array( // Opcional (atributos para input HTML/HTML5)
                            'placeholder' => __( 'Some text here!' )
                        ),
                        'description' => __( 'Utilize este campo para enviar qualquer dúvida e solicitar o valor de envio.', 'odin' ), // Opcional
                    ),
                    array(
                        'id'          => 'produto', // Obrigatório
                        'label'       => array(
                            'text'  => __( 'Produtos', 'odin' ) // Obrigatório
                        ),
                        'type'        => 'hidden', // Obrigatório
                        //'required'    => true, // Campo obrigatório (true/false) Opcional
                        'attributes'  => array( // Opcional (atributos para input HTML/HTML5)
                            'placeholder' => __( 'Seu nome' )
                        ),
                        'default' => $produto
                    ),
                )
            )
        )
    );
adammacias commented 8 years ago

@matheusilario já foi confimado um bug nesta funcionalidade aqui #397 :(

matheusilario commented 8 years ago

Ok, Foi mal.