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