Skip to content
Snippets Groups Projects
Commit 86dea3d5 authored by gnaegi's avatar gnaegi
Browse files

OO-814 fix resolving of images in CP editor

parent 892518ba
No related branches found
No related tags found
No related merge requests found
...@@ -111,14 +111,12 @@ public class VFSRootCPContainer extends AbstractVirtualContainer implements VFSC ...@@ -111,14 +111,12 @@ public class VFSRootCPContainer extends AbstractVirtualContainer implements VFSC
@Override @Override
public VFSItem resolve(String path) { public VFSItem resolve(String path) {
// 1) try to resolve directly from root (editor initialization) // 1) try to resolve directly from root (HTML editor instance)
if (!path.startsWith("/")) { VFSItem item = rootContainer.resolve(path);
VFSItem item = rootContainer.resolve(path); if (item != null) {
if (item != null) { return item;
return item;
}
} }
// 2) try to resolve from virtual containers (events from link chooser) // 2) try to resolve from virtual containers (events from link chooser)
for(VFSItem root:roots) { for(VFSItem root:roots) {
if(root instanceof VFSContainer) { if(root instanceof VFSContainer) {
...@@ -126,7 +124,7 @@ public class VFSRootCPContainer extends AbstractVirtualContainer implements VFSC ...@@ -126,7 +124,7 @@ public class VFSRootCPContainer extends AbstractVirtualContainer implements VFSC
String dir = container.getName(); String dir = container.getName();
if (path.startsWith("/" + dir + "/")) { if (path.startsWith("/" + dir + "/")) {
// remove virtual directory name from path to resolve from real container // remove virtual directory name from path to resolve from real container
VFSItem item = container.resolve(path.substring(dir.length() + 1)); item = container.resolve(path.substring(dir.length() + 1));
if(item != null) { if(item != null) {
return item; return item;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment