Issue Bug Closed

#108282Imports in EXT:form templates does not work.

Stefan Froemken 11/23/25, 22:32 updated 12/02/25, 11:48

Description

Hi,

I tried the “imports” declaration for form templates, but I don’t get it to work.

ChangeLog: Feature: #106477 – Allow YAML imports and placeholder processing when creating new forms

Quote:

such as environment variables in the format :yaml:`%env(ENV_NAME)%`, as well as imports of other YAML files.

My form template:

imports:
  - { resource: 'Imports/Username.yaml' }
renderingOptions:
  submitButtonLabel: Submit
type: Form
identifier: registerUser
label: 'Register User'
prototypeName: standard
finishers:
  -
    options:
      subject: 'New Registration'
      recipients:
        info@typo3lexikon.de: 'Stefan Frömken'
      senderAddress: info@typo3git.ddev.site
      senderName: Stefan
      addHtmlPart: true
      attachUploads: true
      title: 'New Registration'
      errorMessage: ''
    identifier: EmailToReceiver
    defaultValue: ''
  -
    options:
      table: fe_users
      mode: insert
      databaseColumnMappings:
        pid:
          value: 4
        usergroup:
          value: 1
      elements:
        username:
          mapOnDatabaseColumn: username
        password:
          mapOnDatabaseColumn: password
          hashed: true
    identifier: SaveToDatabase
renderables:
  -
    renderingOptions:
      previousButtonLabel: 'Previous step'
      nextButtonLabel: 'Next step'
    type: Page
    identifier: page-1
    label: Step
    renderables:
      -
        defaultValue: ''
        type: Password
        identifier: password
        label: Password %env(TYPO3_CONTEXT)%

And here is my Import:

renderables:
  -
    renderables:
      -
        defaultValue: ''
        type: Text
        identifier: username
        label: Username
        properties:
          fluidAdditionalAttributes:
            autocomplete: 'off'

I have tried various approaches:

renderables:
  -
    identifier: page-1
    renderables:
      -
        defaultValue: ''
        type: Text
        identifier: username
        label: Username
        properties:
          fluidAdditionalAttributes:
            autocomplete: 'off'
renderables:
  -
    type: Page
    identifier: page-1
    renderables:
      -
        defaultValue: ''
        type: Text
        identifier: username
        label: Username
        properties:
          fluidAdditionalAttributes:
            autocomplete: 'off'

And also tried another ways of import:

imports:
  - { resource: 'EXT:site_package/Configuration/Yaml/NewForms/Imports/Username.yaml' }

Nothing works. Here the error messages:

The form editor has stopped working.
Please contact your administrator. Technical Reason: Could not find form element "password" in path "registration/page-1/password" (1472424334)

The form editor has stopped working.
Please contact your administrator. Technical Reason: "identifier" must not be empty (1475436040)

(1/1) #1325697085 InvalidArgumentException
The options "imports" were not allowed (allowed were: "rendererClassName, renderingOptions, finishers, formEditor, label, variants")

Can you please provide a working example in ChangeLog?

Stefan

Reviews 1

History 35

  1. Josua Vogel commented <span data-processor="relativetime" data-value="2025-11-25T14:15:26+00:00" > 11/25/25, 14:15 </span>

    Hi @froemken ,

    I tested this functionality with the following setup, and it worked:

    imports:
      - { resource: 'Username.yaml' }
    identifier: ext-form-simple-contact-form-example
    label: 'Simple Contact Form'
    type: Form
    finishers:
      -
        identifier: EmailToReceiver
        options:
          subject: 'Your message: {subject}'
          recipients:
            your.company@example.com: 'Your Company name'
          senderAddress: '{email}'
          senderName: '{name}'
          replyToRecipients: {}
          carbonCopyRecipients: {}
          blindCarbonCopyRecipients: {}
          format: 'html'
          attachUploads: 'true'
          translation:
            language: ''
          title: 'Confirmation of your message'

    The imported file:

    renderables:
      -
        type: Page
        identifier: page-1
        renderables:
          -
            defaultValue: ''
            type: Text
            identifier: username
            label: Username
            properties:
              fluidAdditionalAttributes:
                autocomplete: 'off'

    I think it´s not possible to merge the renderable list, if you define e.g. page-1 multiple times.
    I will provide some examples to the rst

  2. Josua Vogel commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2025-11-26T10:20:07+00:00" > 11/26/25, 10:20 </span>

    Applied in changeset commit:332578fcd0729e4a950dad62b9f880fb681a2794.