[magnolia-dev] [JIRA] (MGNLUI-4223) Exception in show versions when there is a LinkField to another workspace: Sub-app detail failed to start
"JIRA (on behalf of Jonathan Ayala)" <jira-O8DnXSz/[email protected]> Tue, 13 Jun 2017 13:25:08 +0200 (CEST)
| Newsgroups | gmane.comp.cms.magnolia.devel |
|---|---|
| Message-ID | <[email protected]> |
Jonathan Ayala created an issue
Magnolia UI / https://jira.magnolia-cms.com/browse/MGNLUI-4223 MGNLUI-4223
Exception in show versions when there is a LinkField to another workspace: Sub-app detail failed to start
Issue Type:
Bug
Affects Versions:
5.5.4, 5.4.11
Assignee:
Unassigned
Created:
13/Jun/17 1:24 PM
Priority:
Neutral
Reporter:
Jonathan Ayala
Due to an issue reported on https://jira.magnolia-cms.com/browse/SUPPORT-7609 I have been testing linkField behaviour when using different workspaces from content apps and came across with this problem that could be reproduced in Tours app.
Steps to reproduce:
- In Tours app create a new tour, assign category and image and save.
- Modify it and publish to create some versions
- Restart server*
- Access Tours app and check some version of the created in the previous step. You will get Sub-app detail failed to start
*It is important to restart the server and do not access to the detail of the created tour before trying to see some version.
What I've found when debugging their app is that when detail is accessed, an object of info.magnolia.ui.form.field.converter.BaseIdentifierToPathConverter is used but when version is accessed, there is a Mutable wrapper of info.magnolia.ui.form.field.converter.BaseIdentifierToPathConverter@59d6ba51 with modified properties: workspaceName : data
It produces a NullPointerException when getting JCRSession in
BaseIdentifierToPathConverter.java
try {
Session session = MgnlContext.getJCRSession(workspace);
res = session.getNode(path).getIdentifier();
} catch (RepositoryException e) {
log.error("Unable to convert Path to UUID", e);
}
due to workspace property has not been set properly (it has null value) in
LinkField.java
public LinkField(LinkFieldDefinition linkFieldDefinition, ComponentProvider componentProvider) {
this.definition = linkFieldDefinition;
this.converter = definition.getIdentifierToPathConverter();
if (this.converter != null) {
this.converter.setWorkspaceName(definition.getTargetWorkspace());
}
this.componentProvider = componentProvider;
setIm
What I found interesting is that it only happens if you haven't access to edit/detail before open version details. If you are experiencing the issue and you open the detail of the node, you will be able then to view version details. Somehow workspace property in BaseIdentifierToPathConverter.java is stored and used in the mutable wrapper after accessing edit/detail.
Another things that could matter is that the reporter of the issue said it worked in 5.4.7 but not in 5.4.11 (and probably in higher than 5.4.7) and also that the name of the property workspace is different from workspaceName which is how the setter is called as well as the property in the configuration (JCR or Yaml).
If you need more detailed information don't hesitate in asking me.
Regards.
https://jira.magnolia-cms.com/browse/MGNLUI-4223#add-comment
Add Comment
This message was sent by Atlassian JIRA (v7.2.6#72008-sha1:26175bf)
----------
----------------------------------------------------------------
For list details, see: http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------
(unnamed)
(image/png, 425 B) - not displayed
(unnamed)
(image/gif, 98 B) - not displayed
(unnamed)
(image/png, 1.1 KB) - not displayed
(unnamed)
(image/png, 3.4 KB) - not displayed
(unnamed)
(image/png, 2.9 KB) - not displayed