diff --git a/src/main/java/org/olat/core/commons/modules/bc/commands/CmdEditContent.java b/src/main/java/org/olat/core/commons/modules/bc/commands/CmdEditContent.java
index d9091100e3104ec1b2afb3b339ad67d765eaa5bf..b75e68c6c2abf0b466dbaef164670388484497f8 100644
--- a/src/main/java/org/olat/core/commons/modules/bc/commands/CmdEditContent.java
+++ b/src/main/java/org/olat/core/commons/modules/bc/commands/CmdEditContent.java
@@ -122,8 +122,12 @@ public class CmdEditContent extends BasicController implements FolderCommand {
 		VFSContainer writableRootContainer = folderComponent.getRootContainer();
 		ContainerAndFile result = VFSManager.findWritableRootFolderFor(writableRootContainer, relFilePath);
 		if (result != null) {
-			writableRootContainer = result.getContainer();
-			relFilePath = currentItem.getName();
+			if(currentItem.getParentContainer() != null) {
+				writableRootContainer = currentItem.getParentContainer();
+				relFilePath = currentItem.getName();
+			} else {
+				writableRootContainer = result.getContainer();
+			}
 		} else {
 			// use fallback that always work: current directory and current file
 			relFilePath = currentItem.getName();