Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

auto_config_form

4 sites No security coverage
View on drupal.org

The Schema form module can do everything that this module does, and more. I will continue to fix bugs in this module, but development of new features should happen in Schema form.

Generate your custom module's configuration form automatically from its schema definitions.

Writing config forms is boring. Mostly they all look the same, or are not very important, especially if it's for simple or small modules or for a limited amount of users. So let's automate it!

Example

If your module has config, it will have a schema file, e.g. at my_module/config/schema/my_module.schema.yml. Here is an example:

my_module.settings:
  type: config_object
  label: 'My module settings'
  translatable: false
  mapping:
    foo:
      type: string
      title: 'Foo'
      label: 'How much foo?'
    bar:
      type: boolean
      title: 'Enable bar'
      label: 'Whether to run bar or not.'

To create an automatic config form using this schema, create my_module/Form/ConfigForm.php with the following:


namespace Drupal\my_module\Form;

use Drupal\auto_config_form\AutoConfigFormBase;

/**
 * Settings form for my module.
 *
 * @package Drupal\my_module\Form
 */
class ConfigForm extends AutoConfigFormBase {

  /**
   * {@inheritDoc}
   */
  protected function getSchemaKey(): string {
    return 'my_module.settings';
  }

}

That's it!

Next steps

Drupal core compatibility

  • Drupal 10: Use version 1.x
  • Drupal 11: Use version 2.x

Drupal 10 needs protected $typedConfigManager; and Drupal 11 needs protected TypedConfigManagerInterface $typedConfigManager;, and they are mutually exclusive. This forces us to maintain separate versions of this module for Drupal 10 and Drupal 11. See https://www.drupal.org/project/auto_config_form/issues/3532554 and https://www.drupal.org/project/auto_config_form/issues/3412011 for where we accidentally messed this up twice.

Similar modules

Activity

Total releases
4
First release
Apr 2025
Latest release
8 months ago
Release cadence
42 days
Stability
100% stable

Release Timeline

Releases

Version Type Release date
2.0.0 Stable Aug 14, 2025
1.2.0 Stable Aug 14, 2025
1.1.2 Stable Aug 14, 2025
1.1.1 Stable Apr 9, 2025