diff --git a/current/core/src/main/java/com/coresecure/brightcove/wrapper/filter/CustomAddDialogTabFilter.java b/current/core/src/main/java/com/coresecure/brightcove/wrapper/filter/CustomAddDialogTabFilter.java index 0d01659..0a7e6f9 100755 --- a/current/core/src/main/java/com/coresecure/brightcove/wrapper/filter/CustomAddDialogTabFilter.java +++ b/current/core/src/main/java/com/coresecure/brightcove/wrapper/filter/CustomAddDialogTabFilter.java @@ -128,6 +128,7 @@ public void doFilter(ServletRequest pRequest, ServletResponse pResponse, FilterC String componentPath = fullRequestPath.substring(0, fullRequestPath.lastIndexOf("/")); String dialogPath = getInheritDialog(slingRequest); if (dialogPath != null) { + LOGGER.debug("dialog path => " + dialogPath); Resource dialogNodeRes = slingRequest.getResourceResolver().getResource(dialogPath); if (dialogNodeRes != null) { Node dialogNode = dialogNodeRes.adaptTo(Node.class); @@ -196,8 +197,16 @@ private void getOriginalTabsFromRes(Node nodeItem, JSONObject originalTabs) thro private String getInheritDialog(SlingHttpServletRequest slingRequest) throws RepositoryException { String fullRequestPath = slingRequest.getRequestURI(); String componentPath = fullRequestPath.substring(0, fullRequestPath.lastIndexOf("/")); + + if (slingRequest.getContextPath().length() > 0) { + componentPath = componentPath.replace(slingRequest.getContextPath(), "/"); + } + String result = null; + LOGGER.trace("contextPath --> " + slingRequest.getContextPath()); + LOGGER.trace("componentPath to start --> " + componentPath); + Resource componentRes = slingRequest.getResourceResolver().getResource(componentPath); int avoidLoop = 0;