Empty fields are saved

Created on 22 August 2023, about 1 year ago
Updated 27 May 2024, 6 months ago

Problem/Motivation

When adding mapping with process plugins configured, but without a source, an "empty" fields entry gets added to the source configuration:

source:
  fields:
    -
      name: ''
      label: ''
      selector: ''

Similarly, if you also check "Unique", you can get this:

 ids:
    '':
      type: string

Steps to reproduce

  1. Add mapping, leave "Source" field empty and add at least one process plugin.
  2. Save.

Proposed resolution

"fields" and "ids" currently get set in MigrationMappingFormBase::submitForm(). There are @todo's there that say that that logic should move to the Migration entity.

So let's move the logic of setting fields and ids to the Migration entity and fix the bug with it along.

This means the following changes:

  1. Methods for adding and removing source fields.
  2. Methods for adding and removing source ids.
  3. In Migration::setMapping() code needs to be added to convert mapping to source configuration.
  4. Test coverage for the new methods.
  5. Test coverage for the new behavior of Migration::setMapping().

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇳🇱Netherlands megachriz

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024