Update trouble on modular form

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:
form name attribute outputs empty where it should be contact like in form YALM front matter
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.

Please help

Can you paste the form definition? Also the form modular page content.

Here 1) form definition and 2) form modular page content

  1. form definition
title: ホーム
menu: home
onpage_menu: true
body_classes: "modular header-image fullwidth"
    active: false

    name: name 
    action: /home
        - name: name
          label: 名前
          placeholder: 御名前を …
          classes: curtain-contact-form
          autofocus: off
          autocomplete: on 
          type: text
            required: true

        - name: email
          label: メールアドレス
          placeholder: メールアドレスを …
          classes: curtain-contact-form
          type: email
            rule: email
            required: true

        - name: message
          label: 伝言
          placeholder: 御作文を …
          classes: curtain-contact-form
          type: textarea
            required: true

        - type: submit
          value: 認証
        - type: reset
          value: 取り消し

        - email:
            from: "{{ config.plugins.email.from }}"
              - "{{ config.plugins.email.from }}"
              - "{{ form.value.email }}"
            subject: "[Site Contact Form] {{ form.value.name|e }}"
            body: "{% include 'forms/data.html.twig' %}"
        - save:
            fileprefix: contact-
            dateformat: Ymd-His-u
            extension: txt
            body: "{% include 'forms/data.txt.twig' %}"
        - message: ご連絡を感謝しています ♪
        - display: thankyou

    items: '@self.modular'
        by: default
        dir: asc
            - _landing-curtain
            - _blog
            - _docs
            - _about
            - _contact
  1. form modular page content
title: 御問い合わせ
menu: 御問い合わせ
cache_enable: false



I can see the form just fine.

Make sure you use the correct header delimiters (---) as I don’t see them in your code pasted here, but might be because of formatting.

header delimiters are correct.

Problem is exposed in first post (please have a look at it):
after update, GRAV do not seem to be able to output form name and form action anymore.

I wonder if it is not related to:

  • subdomain structure of site
  • modular structure of page
  • both

Also, after update, GRAV was not either able to read {{ langswitcher.current }} variabme anymore

Any idea?

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.

Thank you. So do I. Everything works apart except on this modular page.

Folder structure of modular page is:

  `modular.ja.md` (header paste above in previous post)

form.html.twig stand from mytheme/modular/form.html.twig [my theme works in inheritance with antimatter 1)mytheme 2)Antimatter]
and is coded:

<div class="modular-row showcase" style="padding-bottom: 8rem;">
{% block content %}
    {{ content }}
    {% include "forms/form.html.twig" %} 
{% endblock %}

I made a test renaming form to form2 but 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) %}
        {% include "forms/fields/#{field.type}/#{field.type}.html.twig" %}
{% 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 %}

  {{ nonce_field('form', 'form-nonce') }}

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.

So modular page are probably problematic

Thanks in advance

please help

OK (despear must be a condition of success!)

it’s was the asset and maintenance plugin!

*see bottom of this page > If the form fields do not appear if you have installed the Assets plugin disable / uninstall it. There's a known issue with it breaking modular forms will be soon fixed