Error when creating database

Created on 9 July 2025, 3 months ago

Problem/Motivation

I receive a fatal error when I want to create a database via admin/migrate-wizard/list-databases/create-mw-database

The website encountered an unexpected error. Try again later.

TypeError: Illegal offset type in Drupal\migrate_wizard\Form\CreateMWDatabase->buildForm() (line 86 of modules\contrib\migrate_wizard\src\Form\CreateMWDatabase.php).

Proposed resolution

The problem is with

$form[$database_field] = [
'#type' => 'textfield',
'#title' => $title,
'#size' => '20',
];

$database_field is not a string, but a Translatable.

$form[(string) $database_field] = [
'#type' => 'textfield',
'#title' => $title,
'#size' => '20',
];

fixes it.

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇳🇱Netherlands koosvdkolk

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

Comments & Activities

Production build 0.71.5 2024