Failure when trying to add a process plugin after "Static map"

Created on 18 August 2023, over 1 year ago
Updated 29 May 2024, 7 months ago

Problem/Motivation

When you have a mapping row with the process plugin "Static map" applied, trying to add another process plugin in the UI results into the following fatal error:

TypeError: Drupal\feeds_migrate\Plugin\migrate\process\Form\StaticMapForm::mapValuesString(): Argument #1 ($values) must be of type array, string given, called in (..)/feeds_migrate/src/Plugin/migrate/process/Form/StaticMapForm.php on line 61 in Drupal\feeds_migrate\Plugin\migrate\process\Form\StaticMapForm->mapValuesString() (line 162 of (..)/feeds_migrate/src/Plugin/migrate/process/Form/StaticMapForm.php).

And also the following error:

TypeError: array_diff(): Argument #1 ($array) must be of type array, null given in array_diff() (line 627 of (..)/feeds_migrate/src/MappingFieldFormBase.php).

With javascript enabled, try to add another process plugin fails silently. With javascript disabled, you get a page with the fatal error displayed.

Steps to reproduce

  1. Create a migration.
  2. Add a mapping row with the process plugin "Static map" applied.
  3. On the mapping edit form, try to add another process plugin.

Proposed resolution

The bug looks to be in \Drupal\feeds_migrate\MappingFieldFormBase::loadProcessPlugins(). Try to fix it and also add test coverage for each process plugin form that is currently available.

Remaining tasks

  • Fix the bug.
  • Add a functional test for configuring the process plugin form "default_value_form".
  • Add a functional test for configuring the process plugin form "static_map_form".

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