Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Data and Content Fixtures

No security coverage Under active development 22 sites

This module provides a tool to easily create dummy content for local development and testing environments. It allows you to generate various types of content, such as entities, configurations, and custom structures, to populate a Drupal site from scratch. This is particularly useful for workflows where a clean, content-free environment is needed for development or continuous integration.

Drupal Data Fixtures module

The fixtures module allows you to easily create dummy content.

Requirements:

  • drush

Installation

  • Install and enable the module
  • Implement a Generator interface (see Basic concepts for more info)
  • run drush fixtures-load inside a working drupal installation

Road Map

  • User interface for all available commands
  • Run only a certain set of generators

Disclaimer

This module was built with a certain workflow in mind. It might work well for you. It might not. Feel free to open any issues if you feel it missing features.

This module **is not** production ready. It will never be this. It is intended for **local development only**. Optionally, you can use it to create working test-environments on the fly with dummy content.

Basic concepts

Each module defining an Entity, ConfigEntity, custom structure, ... that relies on Content to be testable (e.g. an entity bundle, menu items, ...) can also define Generators.
These generators will run by this module to automatically create a working Drupal environment from scratch.

This is epscially useful if your CI/CD workflow includes creating entirely new environments on the fly without any existing content.
This can be due to contract limitations, privacy-related data like e.g. user accounts or the fact that it is still under development.

We also found it is useful when having a team consisting of "Drupal developers" working together with Front-end developers.
When defining content types, user profiles, custom entities, ... we also provide Generators that generate content for these structures.
This way, a front-end developer does not have to manually create content every time he works on a new feature.

When not to use it

Moving content between environments: Data fixtures is based on the idea we can simply Truncate the db if needed.
Deploying real content to production: Data fixtures is based on random data. Let's keep it that way

Generators

Each Generators needs to implement the Drupal\data_fixtures\Interfaces\Generator interface.
It has 2 methods: load and unload.

To register a Generator, add it to your services.yml file and tag it with "data_fixtures"

tags:
    - { name: data_fixtures }

Available commands:

  • drush fixtures-load -> runs the load method on all Generators.
  • drush fixtures-unload -> runs the unload method on all Generators.
  • drush fixtures-reload -> runs fixtures-unload and fixtures-load, in that order.
Drupal 8–11

Ask your assistant about Data and Content Fixtures

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Jun 2023
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Slowing

Release Timeline

Releases

Version Type Core PHP Release date
8.x-1.10 Stable 8–11 Dec 31, 2024
8.x-1.9 Stable 8–10 PHP >=7.2 May 7, 2024
8.x-1.8 Stable 8–10 PHP >=7.2 Jun 27, 2023