ID List Option in UI only supports integer ids

Created on 27 September 2023, 9 months ago

Problem/Motivation

I have a site where the admin user uses the migration UI to update specific content, using the idlist option, where the data comes from an outside source. Now it seems that option form field has a strict pattern that is tied to that text field which prevents the migration from running as the browser blocks the form submission. Would we be able to update that pattern or remove it altogether from that form field?

Note: The migration runs fine when using drush but our user in this case does not have access to drush or the command line.

In MigrationExecuteForm.php Line 160:

$form['options']['idlist'] = [
      '#type' => 'textfield',
      '#title' => $this->t('ID List'),
      '#maxlength' => 255,
      '#size' => 60,
      '#pattern' => '^[0-9]+(' . MigrateTools::DEFAULT_ID_LIST_DELIMITER . '[0-9]+)?(,?[0-9]+(' . MigrateTools::DEFAULT_ID_LIST_DELIMITER . '[0-9]+)?)*$',
      '#description' => $this->t('Comma-separated list of IDs to process.'),
      '#states' => [
        'enabled' => [
          ':input[name="operation"]' => [['value' => 'import'], 'or', ['value' => 'rollback']],
        ],
      ],
    ];

Steps to reproduce

  1. Visit any migration through the UI.
  2. Enter in any string (alphabet) in the idlist option.
  3. Try executing, the browser will prevent you from running your migration.

Proposed resolution

Remove/edit the pattern for the idlist form field

πŸ› Bug report
Status

Active

Version

6.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States danielkim7755 San Diego

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

Comments & Activities

Production build 0.69.0 2024