Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Content field override (cfo)

No security coverage Under active development

This module allows you to override field values of content entities directly in `settings.php`, without a user interface. It's useful for protecting sensitive information or altering values in testing environments by using environment variables. The module intercepts entity loading, copies the original field value to a temporary field, and then replaces it with your configured value.

Override field values of content entities via settings.php and it has no UI.

Why to do this:

If you have config or private information managed via content entities you you may want to protect them or just alter them on testing workflows via settings.php e.g. with ".env" variables.

Good to know

Currently only developed and tested with single value string fields.
Primary on hook_entity_storage_load the field value will be copied to new pseudo field (prepfixed with "cfo_") and replaced by configured value. Be care of large fieldnames because there is a max length. If there is a need we can add settings for specifiying the "helper" fieldname. In any case everything should be tested before using on productive sites.

You need to know the uuid of the entity or you can use a serial entity ID but you need alos need the basic field for this like "nid" on nodes (see example below).

Config example in settings.php

$settings['cfo.settings']['node']['items']['nid']['1'] = [
  'title' => 'Hello world!'
];

This is similar to Configuration overrides like

$config['system.site']['name'] = 'My Drupal site';

Ask your assistant about Content field override (cfo)

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
1
Tracked since
Jul 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Dormant

Releases

Version Type Core PHP Release date
1.0.x-dev Dev 10–11 Jul 20, 2025