[CONTEXT-3] No suitable constructor for dialog of translate story Created: 21/Sep/20  Updated: 24/Sep/20  Resolved: 24/Sep/20

Status: Closed
Project: Content Editor Extended
Component/s: i18n
Affects Version/s: 2.0.5
Fix Version/s: 2.1

Type: Bug Priority: Neutral
Reporter: Richard Gange Assignee: Richard Gange
Resolution: Fixed Votes: 0
Labels: actions, dialogs
Remaining Estimate: 0d
Time Spent: 0.5d
Original Estimate: Not Specified

Issue Links:
relation
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
Epic Link: 6.2-update
Story Points: 20

 Description   

While running against 6.2 attempting to translate a story throws constructor exception for the dialog.

2020-09-21 20:13:12,894 ERROR fo.magnolia.ui.contentapp.browser.BrowserPresenter: An error occurred while executing action [translateStory]
info.magnolia.ui.api.action.ActionExecutionException: Could not instantiate action class for action: translateStory
	at info.magnolia.ui.api.action.AbstractActionExecutor.createAction(AbstractActionExecutor.java:92) ~[magnolia-ui-api-6.2.2.jar:?]
...
...
Caused by: info.magnolia.objectfactory.MgnlInstantiationException: Failed to create instance of [class info.magnolia.editor.i18n.action.TranslateStoryDialogAction]

If I add @Inject to the constructor I get:

2020-09-24 17:17:50,036 ERROR fo.magnolia.ui.contentapp.browser.BrowserPresenter: An error occurred while executing action [translateStory]
info.magnolia.ui.api.action.ActionExecutionException: Could not instantiate action class for action: translateStory
	at info.magnolia.ui.api.action.AbstractActionExecutor.createAction(AbstractActionExecutor.java:92) ~[magnolia-ui-api-6.2.2.jar:?]
...
...
Caused by: info.magnolia.objectfactory.MgnlInstantiationException: Unable to resolve parameters [EditorValidator at 2, EditorCallback at 3] of ctor [TranslateStoryDialogAction(TranslateStoryActionDefinition, Item, EditorValidator, EditorCallback, ContentEditorI18nService, UiContext)]


 Comments   
Comment by Richard Gange [ 24/Sep/20 ]

In order to workaround this issue I had to create a new action to open the dialog. Added a new class OpenTranslateStoryDialogAction which takes the old dialog as configuration via the dialogName property. This property comes from the new definition class OpenTranslateStoryDialogActionDefinition which extends OpenCreateDialogActionDefinition.

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