Previous fix didn't work if you don't Save() the document +don't publish copies.
This commit is contained in:
@@ -976,10 +976,14 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="userId">Optional Id of the User copying the Content</param>
|
||||
/// <returns>The newly created <see cref="IContent"/> object</returns>
|
||||
public IContent Copy(IContent content, int parentId, bool relateToOriginal, int userId = -1)
|
||||
{
|
||||
{
|
||||
var copy = ((Content)content).Clone();
|
||||
copy.ParentId = parentId;
|
||||
|
||||
// A copy should never be set to published
|
||||
// automatically even if the original was
|
||||
this.UnPublish(copy);
|
||||
|
||||
if (Copying.IsRaisedEventCancelled(new CopyEventArgs<IContent>(content, copy, parentId), this))
|
||||
return null;
|
||||
|
||||
@@ -987,7 +991,7 @@ namespace Umbraco.Core.Services
|
||||
using (var repository = _repositoryFactory.CreateContentRepository(uow))
|
||||
{
|
||||
SetWriter(content, userId);
|
||||
|
||||
|
||||
repository.AddOrUpdate(copy);
|
||||
uow.Commit();
|
||||
|
||||
|
||||
@@ -67,6 +67,7 @@ namespace umbraco.ActionHandlers
|
||||
LogHelper.Debug<umbEnsureUniqueName>("Title changed from '" + documentObject.Text + "' to '" + currentName + "' for document id" + documentObject.Id);
|
||||
|
||||
documentObject.Text = currentName;
|
||||
documentObject.Save();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user