[MGNLCTS-118] Export not working if dialogs defined using UI6 Created: 23/Sep/20  Updated: 25/Oct/20  Resolved: 25/Oct/20

Status: Closed
Project: Content Translation Support
Component/s: None
Affects Version/s: 2.4.2
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Monica Damborenea Assignee: Federico Grilli
Resolution: Duplicate Votes: 1
Labels: 623, maintenance
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
duplicate
duplicates MGNLCTS-116 Export not working if dialogs defined... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Epic Link: Support
Sprint: Maintenance 30

 Description   

If you try to export  a translation in the Content translation app, regardless of the chosen format (excel, xliff, cvs, ..), and if the dialogs are defined with the Magnolia 6 UI framework, you get an error: "Export of translation file failed"

This is not happening if the dialogs are defined using Magnolia 5 UI framework

Steps to reproduce

  • Create a page in the pages app
  • Add a dialog defined using UI6, for example:
    form:
      properties:
        text:
          $type: textField
          label: Body
          defaultValue: testing
          rows: 5
          maxLength: 300
    
  • Go to the Content translation app, select the page and click on "Export translation"

Expected results
The file should be exported with no error
 
Actual results
The file is not exported and you get an error, find the full error attached.

ERROR tion.ui.action.TranslationFileDownloadDialogAction: An error occurred when executing the command downloadTranslationFile from catalog translation
java.lang.ClassCastException: info.magnolia.ui.dialog.ConfiguredFormDialogDefinition cannot be cast to info.magnolia.ui.dialog.definition.FormDialogDefinition


 Comments   
Comment by Jonathan Ayala [ 14/Oct/20 ]

Issue occurs after executing the following lines where the form is explicitly casted to the 5UI class info.magnolia.ui.dialog.definition.FormDialogDefinition

info.magnolia.translation.finder.DialogBasedPropertiesToTranslateFinder.getPropertiesToTranslate(Node)
 
...
            FormDialogDefinition dialogDefinition = null;
            try {
                dialogDefinition = (FormDialogDefinition) dialogDefinitionRegistry.getProvider(dialogName).get();
            } catch (Registry.NoSuchDefinitionException e) {
                log.warn("Could not get dialog definition for dialog named {}.", dialogName);
            }
...

The new dialog definition info.magnolia.ui.dialog.ConfiguredFormDialogDefinition must be covered as well.

Generated at Mon Feb 12 00:33:24 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.