Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Release: Opensolr Search 4.5.0 Minor update available for module opensolr_search (4.5.0). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Migrate Default If No Stored Value

12 sites Security covered Drupal 9–11
View on drupal.org

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.

Depends on

Dependencies of the latest stable release

  • migrate Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

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

Releases

Version Type Core Release date
1.1.0 Stable 9–11 Apr 21, 2025