Skip to content

Commit

Permalink
Fix #216 - Run the folder clean up on all saves !
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Jump committed Mar 31, 2021
1 parent 0d70de5 commit 84a8a33
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions uSync8.BackOffice/SyncHandlers/SyncHandlerRoot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1135,13 +1135,16 @@ protected virtual void EventSavedItem(IService sender, SaveEventArgs<TObject> e)
var attempts = Export(item, Path.Combine(rootFolder, this.DefaultFolder), DefaultConfig);

// if we are using guid names and a flat structure then the clean doesn't need to happen
if (!(this.DefaultConfig.GuidNames && this.DefaultConfig.UseFlatStructure))
{
// if (!(this.DefaultConfig.GuidNames && this.DefaultConfig.UseFlatStructure))

// #216 clean up all the time, because if someone recreates a doctype, we want to find the old
// version of that doctype and call it a rename
// {
foreach (var attempt in attempts.Where(x => x.Success))
{
this.CleanUp(item, attempt.FileName, Path.Combine(rootFolder, this.DefaultFolder));
}
}
// }
}
}

Expand Down
2 changes: 1 addition & 1 deletion uSync8.Site/config/uSync8.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<ImportAtStartup Group="Settings">True</ImportAtStartup>
<ExportAtStartup>False</ExportAtStartup>
<ExportOnSave>True</ExportOnSave>
<UseGuidFilenames>False</UseGuidFilenames>
<UseGuidFilenames>True</UseGuidFilenames>
<BatchSave>False</BatchSave>
<ReportDebug>False</ReportDebug>
<CacheFolderKeys>False</CacheFolderKeys>
Expand Down

0 comments on commit 84a8a33

Please sign in to comment.