Form went out of order after updating through GPM.
Taken appart on a blank page, form YAML front matter is working,
but for some reason,
in modular page
form attribute name is not read anymore: formname attribute outputs empty where it should be contact like in form YALM front matter
and action comes like fr/_contact where it is /home in form YAML front matter.
rest of form YAML front matter is not read anymore either:
no div output for fields name, mail address, or text area.
buttons div appear but not with the form YAML front matter elements.
please note also:
that modular page is also the main landing page of site, main environnement an dit works with setup.php for subsites in folder sites: environnement sites/blog, environnement sites/docs.
I get action and name correctly, as set on the form. Make sure your theme does not override the default partials/form.html.twig or form.html.twig, to exclude a possible source of problems.
I made a test renaming form to form2but no change.
All this was working well before update so it’s probably related to it.
Also variable langswitcher.current went out of order.
plugin/form/templates/forms/default/form.html.twig is
{% if form.message %}<div class="alert">{{ form.message }}</div>{% endif %}
{% set multipart = '' %}
{% set method = form.method|upper|default('POST') %}
{% for field in form.fields %}
{% if (method == 'POST' and field.type == 'file') %}
{% set multipart = ' enctype="multipart/form-data"' %}
{% endif %}
{% endfor %}
<form name="{{ form.name }}"
action="{{ form.action ? base_url ~ form.action : page.url }}"
method="{{ method }}"{{ multipart }}>
{% for field in form.fields %}
{% set value = form.value(field.name) %}
<div>
{% include "forms/fields/#{field.type}/#{field.type}.html.twig" %}
</div>
{% endfor %}
<div class="buttons">
{% for button in form.buttons %}
<button class="{{ button.classes|default('button') }}" type="{{ button.type|default('submit') }}">{{ button.value|t|default('Submit') }}</button>
{% endfor %}
</div>
{{ nonce_field('form', 'form-nonce') }}
</form>
In output, form name is blank and form action set to /fr/_contact instead of correct.
when reproducing modular form on a blank new page apart, same problem: section and title are output, but not form.
Inspecting shows that form nameis blank and form action set to /fr/modularform/_contact instead of correct.
*see bottom of this page > If the form fields do not appearif you have installed the Assets plugin disable / uninstall it.There's a known issue with it breaking modular forms will be soon fixed