Make translatable string public to avoid copy/paste

Created on 13 July 2018, over 6 years ago
Updated 30 January 2023, almost 2 years ago

A follow up from #2864849: Improve migrate UI database credential form involving the migration and database systems.

In comment #44.2 phenaproxima suggested putting a translatable string in a "public static method somewhere in the database system, so we don't have to copy and paste it" in a migration UI form. A good idea for a particularly long string. So, let's do it here.


This the full comment from the original issue posted here for convenience.

+++ b/core/modules/migrate_drupal_ui/src/Form/CredentialForm.php
@@ -245,7 +245,8 @@ public function validateForm(array &$form, FormStateInterface $form_state) {
+        $msg = $this->t('Failed to connect to your database server. The server reports the following message: %error.<ul><li>Is the database server running?</li><li>Does the database exist, and have you entered the correct database name?</li><li>Have you entered the correct username and password?</li><li>Have you entered the correct database hostname?</li></ul>', ['%error' => $e->getMessage()]);

What if we put this string in a public static method somewhere in the database system, so we don't have to copy and paste it here? 
📌 Task
Status

Needs work

Version

10.1

Component
Database 

Last updated 2 days ago

  • Maintained by
  • 🇳🇱Netherlands @daffie
Created by

🇳🇿New Zealand quietone

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

    Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

Production build 0.71.5 2024