@@ -238,6 +238,42 @@ public WBRecord DeclareNewRecord(WBTaskFeedback feedback, String callingUserLogi
238
238
protectedLibraryRootFolder . WBxGetOrCreateFolderPath ( fullClassPath , classFolderType . Id ) ;
239
239
SPFolder actualDestinationFolder = protectedLibraryRootFolder . WBxGetOrCreateFolderPath ( fullFilingPath , filePartFolderType . Id ) ;
240
240
241
+ /*
242
+ // This next bit is all because we've been having problems when new folders had to be created:
243
+ if (actualDestinationFolder == null)
244
+ {
245
+ WBLogging.RecordsTypes.HighLevel("We have to create part of the folder path: " + fullFilingPath);
246
+ actualDestinationFolder = protectedLibraryRootFolder.WBxGetOrCreateFolderPath(fullFilingPath, filePartFolderType.Id);
247
+
248
+ WBLogging.RecordsTypes.HighLevel("Now we're going to add a dummy first file:");
249
+
250
+ MemoryStream memoryStream = new MemoryStream(Encoding.UTF8.GetBytes("Please ignore this file."));
251
+ SPFile dummyFile = actualDestinationFolder.Files.Add("FirstFile.txt", memoryStream);
252
+
253
+ WBLogging.RecordsTypes.HighLevel("Now we're going to try to update the file");
254
+ try
255
+ {
256
+ dummyFile.Item.Update();
257
+ }
258
+ catch (Exception e)
259
+ {
260
+ WBLogging.RecordsTypes.Unexpected("And exception did occur while updating the dummy item", e);
261
+ }
262
+
263
+ memoryStream.Dispose();
264
+
265
+ WBLogging.RecordsTypes.HighLevel("Now re-opening the whole ProtectedMasterLibrary object");
266
+
267
+ ProtectedMasterLibrary.ReOpen();
268
+
269
+ WBLogging.RecordsTypes.HighLevel("Have re-opened the whole ProtectedMasterLibrary object - now re-getting the SPFolder:");
270
+
271
+ protectedLibraryRootFolder = ProtectedMasterLibrary.List.RootFolder;
272
+ actualDestinationFolder = protectedLibraryRootFolder.WBxGetFolderPath(fullFilingPath);
273
+ }
274
+ */
275
+
276
+
241
277
if ( ProtectedMasterLibrary . Web . WBxFileExists ( actualDestinationFolder , filename ) )
242
278
{
243
279
filename = ProtectedMasterLibrary . Web . WBxMakeFilenameUnique ( actualDestinationFolder , filename ) ;
0 commit comments