Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

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';

Activity

Total releases
1
First release
Jul 2025
Latest release
11 months ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Slowing

Releases

Version Type Release date
1.0.x-dev Dev Jul 20, 2025