This project is not covered by Drupal’s security advisory policy.

Site builders

This module provides no direct functionality, so only download it if another module lists it as a dependency, or if you want to write your own module that uses its API.

Developers

Field UI and API are designed with the assumption that modules define field types, and administrators create fields and instantiate them within bundles. As part of this assumption, Field API automatically deletes fields when they're no longer in use by any bundles, and Field UI populates the add existing field dropdown only with fields that are in use by at least one bundle. This presents an annoyance for modules that want to define a field and make it available for adding to bundles, but without requiring any particular bundle to use it. ModuleField compensates for this: simply implement hook_modulefield_info() with your field definition and default instance definition, and ModuleField exposes this field within Field UI's add existing field dropdown even if the field has not yet been instantiated in any bundle.

If you're interested in seeing this capability added to Drupal 8 core, please see #1426804: Allow field storages to be persisted when they have no fields..

Examples

This module is used by TAC Redirect 403, so you can inspect that module's code for a real-world example. If you know of any other modules that use ModuleField, please submit an issue for that module to be referenced from here.

Credits

This project was sponsored by Acquia as part of the Drupal Gardens project.

Project information

Releases