1

I'm migrating URLs that don't have corresponding titles into a link field, and when I either don't define the title, or use the default_value plugin to set the default value to '', the value actually gets set to NULL, instead of an empty string, which breaks my link formatter, that expects link titles to be strings (even if the strings are empty):

    process:
      field_link/title:
        - plugin: default_value
          default_value: ''

How can I insert the titles as an empty string, instead of NULL?

1 Answer 1

4

I found the solution was to create an empty string as a constant, in the migration source, and then reference that:

source:
  constants:
    empty: ''

process:
  field_link/title: constants/empty
1
  • Nice post, thank you for sharing.
    – Jaypan
    Mar 23, 2023 at 4:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.