-
Bug
-
Resolution: Fixed
-
Neutral
-
5.4.11, 5.5.4, 5.6
-
None
-
None
-
-
Empty show more show less
-
Kromeriz 140, Basel 143
-
5
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
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
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.
- relates to
-
MGNLDAM-748 Add getter for workspaceName in AssetCompositeIdKeyTranslator
- Closed