我已经实施了一个表格来注册用户的电子邮件,因此我们可以发送更新。
该表格在集成方面非常完美,但没有理由的生产失败。
当我尝试发送消息时,我会收到500个帖子错误,并提供以下信息:
{error: {type: "WhoopsExceptionErrorException", message: "Undefined index: type",…}}
error : {type: "WhoopsExceptionErrorException", message: "Undefined index: type" , …}
file : "/var/www/20170803_project/user/plugins/form/classes/form.php"
line : 552
message : "Undefined index: type"
type : "WhoopsExceptionErrorException"
生成表格的代码:
{% set scope = scope ?: 'data.' %}
{% set multipart = '' %}
{% set method = form.method|upper|default('POST') %}
{% set action = form.action ? base_url ~ form.action : base_url ~ page.route
~ uri.params %}
{% if (action == base_url_relative) %}
{% set action = base_url_relative ~ '/' ~ page.slug %}
{% endif %}
<form name="{{ form.name }}"
action="{{ action }}"
method="{{ method }}"{{ multipart }}
{% if form.id %}id="{{ form.id }}"{% endif %}
{% block form_classes %}
{% if form.classes %}class="{{ form.classes }}"{% endif %}
{% endblock %}
>
<div class="stay_tune pure-u-4-5 pure-g">
{% block inner_markup_fields_start %}{% endblock %}
<div class="group pure-u-3-5 email_register_container">
<input name="email" type="email" required>
<span class="highlight"></span>
<span class="bar"></span>
<label class="label">Email</label>
</div>
{% include "forms/fields/formname/formname.html.twig" %}
{% block inner_markup_fields_end %}{% endblock %}
{% block inner_markup_buttons_start %}
<div class="pure-u-2-5 register_button_container">
{% endblock %}
{{dump(form)}}
<p class="message_form">{{form.process[1].message}}</p>
<button type="submit" class="register_button" name="button">
{{form.button.value}}</button>
{% block inner_markup_buttons_end %}
</div>
{% endblock %}
</div>
{{ nonce_field('form', 'form-nonce')|raw }}
</form>
我确实检查了许可并清除缓存而没有成功,我没有想法。
谢谢。
552
处的文件 /user/plugins/form/classes/form.php
包含以下代码 if ($field['type'] == 'checkbox') {
行,这意味着:如果字段类型为'复选框',则...
您的错误"未定义索引:类型"(与数组完全关联)指出,他在$field
数组中找不到索引'type'。
此代码(第552行)也在称为post()
的函数中执行。
所以,我可以推断出来:在邮政请求之后检查您的字段时,其中一个没有type
属性。
要解决问题,您可以在表单上检查生成的HTML输出(检查元素)并找到错误的格式输入。
您的复选框似乎有问题。
您可以发布表格定义吗?