--- Base (BASE) +++ Locally Modified (Based On LOCAL) @@ -38,6 +38,7 @@ import info.magnolia.cms.core.ItemType; import info.magnolia.cms.exchange.Syndicator; import info.magnolia.cms.util.AlertUtil; +import info.magnolia.cms.util.ContentUtil; import info.magnolia.cms.util.FactoryUtil; import info.magnolia.cms.util.Rule; import info.magnolia.commands.MgnlCommand; @@ -115,9 +116,13 @@ if(StringUtils.isEmpty(rootPath)) { throw new Exception("Cannot find root path for item type " + itemType); } - Content root = MgnlContext.getHierarchyManager(DataModule.getRepository()).getRoot().getChildByName(rootPath.substring(1)); + Content root = ContentUtil.getContent(DataModule.getRepository(), rootPath); + if (root != null) { return checkChildren(root.getJCRNode(), itemType); + } else { + return false; } + } private boolean checkChildren(Node parent, String itemType) throws RepositoryException { boolean exist = false;