我已经实现了一个表格来注册用户的电子邮件,以便我们可以向他们发送更新。
该表单在集成时完美运行,但在生产中无缘无故失败。
当我尝试发送消息时,我收到一个 500 post 错误,其中包含以下信息:
{error: {type: "Whoops\Exception\ErrorException", message: "Undefined index: type",…}}
error : {type: "Whoops\Exception\ErrorException", message: "Undefined index: type" , …}
file : "/var/www/20170803_project/user/plugins/form/classes/form.php"
line : 552
message : "Undefined index: type"
type : "Whoops\Exception\ErrorException"
生成表单的代码:
{% 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>
我确实检查了权限并清除了缓存但没有成功,我没有想法。
谢谢你。