Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Migrate Default If No Stored Value

Security covered Maintenance fixes only 13 sites

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.

Drupal 9–11

Ask your assistant about Migrate Default If No Stored Value

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

  • migrate Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Jul 2023
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP Release date
1.1.0 Stable 9–11 Apr 21, 2025
1.0.1 Stable 9–10 Jul 3, 2023
1.0.0 Stable 8–10 Jul 3, 2023