code.onehippo.org is currently readonly. We are migrating to code.bloomreach.com, please continue working there on Monday 14/12. See: https://docs.bloomreach.com/display/engineering/GitLab

Commit c59f8673 authored by Sergey Shepelevich's avatar Sergey Shepelevich

REPO-1857 Fix Node#getDisplayName for root node

parent 8564cbd0
...@@ -282,8 +282,11 @@ public class NodeDecorator extends org.hippoecm.repository.decorating.NodeDecora ...@@ -282,8 +282,11 @@ public class NodeDecorator extends org.hippoecm.repository.decorating.NodeDecora
@Override @Override
public String getDisplayName() throws RepositoryException { public String getDisplayName() throws RepositoryException {
Node node = this; Node node = this;
if (!isNodeType(HippoNodeType.NT_NAMED)) { if (!node.isNodeType(HippoNodeType.NT_NAMED)) {
Node parent = node.getParent(); if (node.equals(node.getSession().getRootNode())) {
return getName();
}
final Node parent = node.getParent();
if (parent.isNodeType(HippoNodeType.NT_HANDLE) && parent.isNodeType(HippoNodeType.NT_NAMED)) { if (parent.isNodeType(HippoNodeType.NT_HANDLE) && parent.isNodeType(HippoNodeType.NT_NAMED)) {
node = parent; node = parent;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment