Problem/Motivation
The migration UI re-uses the installation database form to gather db credentials from the user. This works great apart from the fact that we do:
$db_prefix = ($profile == 'standard') ? 'drupal_' : $profile . '_';
$form['advanced_options']['prefix'] = [
'#type' => 'textfield',
'#title' => t('Table name prefix'),
'#default_value' => empty($database['prefix']) ? '' : $database['prefix'],
'#size' => 45,
'#description' => t('If more than one application will be sharing this database, a unique table name prefix – such as %prefix – will prevent collisions.', ['%prefix' => $db_prefix]),
'#weight' => 10,
];
The description makes no sense in the migrate case (it does during installation).
This was found in #3086374: Make Drupal 8 & 9 compatible with PHP 7.4 due to the global $install_state not being set and new errors being emitted from PHP. Running Drupal\Tests\migrate_drupal_ui\Functional\d6\MultilingualReviewPageTest
showed the error.
Proposed resolution
Remove the description.
Before
After
Original proposal
We should change the description for this form field in \Drupal\migrate_drupal_ui\Form\CredentialForm::buildForm() and perhaps rework the logic in \Drupal\Core\Database\Install\Tasks::getFormOptions so we don't set a nonsense one for migrate in the first place.
Remaining tasks
User interface changes
New UI text on migrate credentials form.
API changes
None
Data model changes
None
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#10 | interdiff-6-9.txt | 886 bytes | jungle |
#10 | 3110839-9.patch | 868 bytes | jungle |
#6 | After-mysql.png | 32.24 KB | quietone |
#6 | Before-mysql.png | 27.3 KB | quietone |
#6 | 3110839-6.patch | 868 bytes | quietone |
Comments
Comment #2
alexpottComment #3
amjad1233@alexpott Do you have anything in mind for the description of the field?
Comment #4
alexpottWell it needs to tell the user to set it to the prefix used in the drupal site you are migrating from.
Comment #6
quietone CreditAttribution: quietone as a volunteer commentedI'm not sure I agree with alexpott and the original proposed resolution because the title for the section is 'Provide credentials for the database of the Drupal site you want to upgrade.' and I don't see the need to repeat that. With that in mind, here is a patch that removes the description.
Comment #7
mikelutzI agree with @quietone, we don't need a description for the field, the form description describes what to do. I don't think we need a test for this 'bug report' as we are just making some UI text changes.
Comment #8
larowlansuper uber nit pick - any reason we're mixing single and double quotes here? single will suffice in my book
Comment #9
mikelutznw for #8
Comment #10
jungleReplaced all double quotes with single ones where possible.
Comment #11
mikelutzYes, +1 for back to RTBC
Comment #13
larowlanComment #14
larowlanCommitted 7aca346 and pushed to 9.1.x. Thanks!
Comment #17
larowlanBackported to 9.0.x and 8.9.x as this is a bug and there is little risk of disruption