Convert the getExportDescription & getImportDescription methods from string to array

Created on 21 July 2024, 4 months ago

System information

  • Drupal Core Version: ^10.2 || ^11
  • Menu Migration Version: 4.0.0-alpha2
  • PHP Version: >= 8.1 && <= 8.3

Problem/Motivation

Currently, the export & import descriptions and not fully synced between drush and UI. The only part that is common in the code is the plugin description. The general description that concatenates with the plugin description is duplicated in drush and export/import confirmation forms.
It is also difficult to display the whole description on multiple lines in both drush and UI.
Furthermore, when using Drush 13, the export/import description is trimmed. This is because the drush confirmation has a new design and the full description is used as a confirmation question.

Proposed resolution

- Convert the getExportDescription and getImportDescription methods to return an array of translatable strings instead of a translatable string.
- Implement the getExportDescription and getImportDescription methods in the parent plugin base classes and move the general description from drush and the confirmation forms to the plugin base class.
- Update the existing export and import plugins to get the parent description, add the plugin specific description to the retrieved array and return it.
- Update the export/import confirmation forms to return directly the results of the getExportDescription and getImportDescription methods, imploded by BR tag.
- Update the drush mme and drush mmi commands to first print the export/import plugin descriptions, one array value per line, and leave the confirm question to just a simple short string like: "Are you sure?"

📌 Task
Status

Active

Version

4.0

Component

Code

Created by

🇷🇴Romania bbu23

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