From c46902d8c8613a6f44d2ea5739b2f961996dff7d Mon Sep 17 00:00:00 2001
From: srosse <none@none>
Date: Thu, 22 Mar 2012 17:08:40 +0100
Subject: [PATCH] OO-123: load the root container for the Wysiwig editor
 differently.

---
 .../core/commons/modules/bc/commands/CmdEditContent.java  | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

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 d9091100e31..b75e68c6c2a 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();
-- 
GitLab