[MGNLUI-5913] Problems with references in m6 content-type generated apps Created: 07/May/20 Updated: 24/Jun/20 Resolved: 10/Jun/20 |
|
| Status: | Closed |
| Project: | Magnolia UI |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 6.2.2 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Christopher Zimmermann | Assignee: | Robert Šiška |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | 0d | ||
| Time Spent: | 1.5d | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||||||
| Issue Links: |
|
||||||||||||||||
| 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: | UI framework implementation | ||||||||||||||||
| Sprint: | HL & LD 3, HL & LD 4 | ||||||||||||||||
| Story Points: | 3 | ||||||||||||||||
| Description |
|
If you create an m6 app based on a content type, and use the 'reference' field to link to the 'category' content type. Then if you create a new content item and hit the 'Add' button, then an WARN is written to the log:
2020-05-07 18:12:03,412 WARN uddyMutableWrapperHelper$BeanPropertyMethodInvoker: Failed to invoke a fallback getDatasource call due to a reflection operation problem: null, returning nulljava.lang.reflect.InvocationTargetException: nullat sun.reflect.GeneratedMethodAccessor460.invoke(Unknown Source) ~[?:?]at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_151]at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_151]at info.magnolia.config.ByteBuddyMutableWrapperHelper$BeanPropertyMethodInvoker.invokeGetter(ByteBuddyMutableWrapperHelper.java:308) ~[magnolia-configuration-6.2.jar:?]at
Then if you hit the 'Select New' button, an exception is displayed in the app: Failed to create an instance with c-tor [WorkbenchChooser(WorkbenchChooserDefinition, ValueContext)] RpcInvocationException: Unable to invoke method click in com.vaadin.shared.ui.button.ButtonServerRpc caused by InvocationTargetException caused by MethodException: Invocation of method buttonClick in info.magnolia.ui.field.factory.LinkFieldFactory$$Lambda$2015/121201489 failed. caused by MgnlInstantiationException: Failed to create instance of [class info.magnolia.ui.chooser.SingleItemWorkbenchChooser] caused by MgnlInstantiationException: Failed to create an instance with c-tor [SingleItemWorkbenchChooser(SingleItemWorkbenchChooserDefinition)] caused by InvocationTargetException caused by MgnlInstantiationException: Failed to create instance of [class info.magnolia.ui.chooser.WorkbenchChooser] caused by MgnlInstantiationException: Failed to create an instance with c-tor [WorkbenchChooser(WorkbenchChooserDefinition, ValueContext)] caused by InvocationTargetException caused by NullPointerException To reproduce:
|
| Comments |
| Comment by Christopher Zimmermann [ 18/May/20 ] |
|
From stacktrace it looks like the word "reference:" is not stripped from configured "reference:category" before attempting to locate the defintiion.
``` Caused by: info.magnolia.config.registry.Registry$NoSuchDefinitionException: reference:category ``` |
| Comment by Christopher Zimmermann [ 18/May/20 ] |
|
Please include unit test for the problem. |
| Comment by Chris Jennings [ 22/May/20 ] |
|
I also see this happen when linking a content type to itself. datasource:
workspace: events
namespaces:
mt: https://www.magnolia-travel.com/jcr/1.0/mt
autoCreate: true
model:
nodeType: mgnl:event
properties:
- name: date
type: Date
- name: similar
type: reference:event
I have attached |
| Comment by Simon Lutz [ 02/Jun/20 ] |
|
Removed from ticket description as not supported; also see
|
| Comment by Christopher Zimmermann [ 04/Jun/20 ] |
|
slutz What you removed is different from The above is a problem with the content not being valid anymore. The content should be compatible when going from M5 to M6 ui framework. But it is not. It it's not possible then we need to document and provide content migrations. |
| Comment by Robert Šiška [ 04/Jun/20 ] |
|
czimmermann The content is still valid, but from the new ui framework point of view, there is no content-type app that can access it. The m5 content-type app descriptor was moved to framework-compatibility, so in order to support it in new framework, we'd need to move it back. But even if we did that and could link a correct m5 app to given content-type, the m6 WorkbenchChooser is simply not capable of opening m5 apps. So, it's not content that needs to migrated - just the content-type app, which should be just about changing content-type-m5 directive to content-type in the app descriptor. |