aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/AssetInventoryServer/Plugins
diff options
context:
space:
mode:
authorMike Mazur2009-03-05 08:30:23 +0000
committerMike Mazur2009-03-05 08:30:23 +0000
commit1894d69c8a582bec7a5bf96d025f12aa99287816 (patch)
tree5a5ec9037c19169ca92209f6a99faf676defda0e /OpenSim/Grid/AssetInventoryServer/Plugins
parentFix creating inventory items and folders. (diff)
downloadopensim-SC_OLD-1894d69c8a582bec7a5bf96d025f12aa99287816.zip
opensim-SC_OLD-1894d69c8a582bec7a5bf96d025f12aa99287816.tar.gz
opensim-SC_OLD-1894d69c8a582bec7a5bf96d025f12aa99287816.tar.bz2
opensim-SC_OLD-1894d69c8a582bec7a5bf96d025f12aa99287816.tar.xz
Fix moving folders.
Casting from base class to inherited class is a no-no, and we must preserve the folder type when moving folders, otherwise it gets set to a Texture folder (type 0).
Diffstat (limited to 'OpenSim/Grid/AssetInventoryServer/Plugins')
-rw-r--r--OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimInventoryFrontendPlugin.cs11
-rw-r--r--OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimInventoryService.cs2
2 files changed, 9 insertions, 4 deletions
diff --git a/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimInventoryFrontendPlugin.cs b/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimInventoryFrontendPlugin.cs
index 838bc3a..705a3ef 100644
--- a/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimInventoryFrontendPlugin.cs
+++ b/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimInventoryFrontendPlugin.cs
@@ -227,14 +227,19 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
227 { 227 {
228 Uri owner = Utils.GetOpenSimUri(folder.Owner); 228 Uri owner = Utils.GetOpenSimUri(folder.Owner);
229 229
230 // Some calls that are moving or updating a folder instead of creating a new one 230 // Some calls that are moving or updating a folder instead
231 // will pass in an InventoryFolder without the name set. If this is the case we 231 // of creating a new one will pass in an InventoryFolder
232 // need to look up the name first 232 // without the name set and type set to 0. If this is the
233 // case we need to look up the name first and preserver
234 // it's type.
233 if (String.IsNullOrEmpty(folder.Name)) 235 if (String.IsNullOrEmpty(folder.Name))
234 { 236 {
235 InventoryFolderWithChildren oldFolder; 237 InventoryFolderWithChildren oldFolder;
236 if (m_server.InventoryProvider.TryFetchFolder(owner, folder.ID, out oldFolder) == BackendResponse.Success) 238 if (m_server.InventoryProvider.TryFetchFolder(owner, folder.ID, out oldFolder) == BackendResponse.Success)
239 {
237 folder.Name = oldFolder.Name; 240 folder.Name = oldFolder.Name;
241 folder.Type = oldFolder.Type;
242 }
238 } 243 }
239 244
240 BackendResponse storageResponse = m_server.InventoryProvider.TryCreateFolder(owner, folder); 245 BackendResponse storageResponse = m_server.InventoryProvider.TryCreateFolder(owner, folder);
diff --git a/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimInventoryService.cs b/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimInventoryService.cs
index ca995b3..3ddd07d 100644
--- a/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimInventoryService.cs
+++ b/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimInventoryService.cs
@@ -48,7 +48,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
48 48
49 if (null != baseFolder) 49 if (null != baseFolder)
50 { 50 {
51 folder = (InventoryFolderWithChildren) baseFolder; 51 folder = new InventoryFolderWithChildren(baseFolder);
52 folder.Children = null; // This call only returns data for the folder itself, no children data 52 folder.Children = null; // This call only returns data for the folder itself, no children data
53 } 53 }
54 54