[MGNLPN-414] ChangeComponentTemplateAction throws NoSuchDefinitionException when changing to component with no dialog Created: 06/Mar/18 Updated: 23/Aug/22 |
|
| Status: | Open |
| Project: | Magnolia Personalization |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Neutral |
| Reporter: | James Spence | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 2 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| 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
|
| Team: |
| Description |
|
When changing a template to a component that doesn't have a dialog specified (an optional field), a `NoSuchDefinitionException` is thrown by the `ChangeComponentTemplateAction`. This is caused by the following line in the formDialogPresenter callback: final String dialogId = templateDefinitionRegistry.getProvider(String.valueOf(itemToEdit.getItemProperty(NodeTypes.Renderable.TEMPLATE).getValue())).get().getDialog(); Since there is no dialog defined for this new component, that line ends up throwing an exception attempting to retrieve the dialog, causing the action to fail. |
| Comments |
| Comment by James Spence [ 06/Mar/18 ] |
|
I believe the same culprit is responsible for this ticket - https://jira.magnolia-cms.com/browse/MGNLDEMO-216 |