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). Varbase Media Header 9.2.1 Minor update available for module varbase_media_header (9.2.1). 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 provides a migration plugin that sets a default value for a field, but only if the field doesn't already have a value on the destination entity. This prevents overwriting existing data during migrations.

This module provides a migration processing plugin that will allow you to set a fields default value ONLY if a value does not already exist on the destination node.

One problem we encountered at OHSU was that while we wanted a "default_value" for a particular field, it was aggressively setting that default value if we ever ran a migration with the update flag.

We were unable through searching to determine a way to use core migrate or migrate plus to accomplish this task, and so this module has come to exist.

Usage Use:

Check out the example below. You will place an equivalent in your migrations configuration YML file, for processing a field.

field_prof_provider_type:
    plugin: default_if_no_stored_value
    default_value: Specialist
    entity_type: node
    bundle: profile

Configuration Variables:

default_value - The value you wish to assign if no value is present on the destination
entity_type - The entity type you wish to upload. Currently only "node" is supported
bundle - The entity type bundle you wish to load.

Activity

Total releases
1
First release
Apr 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Dormant

Releases

Version Type Release date
1.1.0 Stable Apr 21, 2025