Merge pull request #2663 from umbraco/temp8-U4-11384

U4-11384 nodes moved to the recycle bin still show up in the cache so remain routable
This commit is contained in:
Shannon Deminick
2018-06-01 11:56:56 +10:00
committed by GitHub
6 changed files with 8 additions and 36 deletions

View File

@@ -199,7 +199,7 @@ namespace Umbraco.Web.Editors
},
{
"logApiBaseUrl", _urlHelper.GetUmbracoApiServiceBaseUrl<LogController>(
controller => controller.GetEntityLog(0))
controller => controller.GetPagedEntityLog(0, 0, 0, Core.Persistence.DatabaseModelDefinitions.Direction.Ascending, null))
},
{
"memberApiBaseUrl", _urlHelper.GetUmbracoApiServiceBaseUrl<MemberController>(

View File

@@ -974,7 +974,7 @@ namespace Umbraco.Web.Editors
{
var toMove = ValidateMoveOrCopy(move);
Services.ContentService.Move(toMove, move.ParentId);
Services.ContentService.Move(toMove, move.ParentId, Security.GetUserId().ResultOr(0));
var response = Request.CreateResponse(HttpStatusCode.OK);
response.Content = new StringContent(toMove.Path, Encoding.UTF8, "application/json");
@@ -991,7 +991,7 @@ namespace Umbraco.Web.Editors
{
var toCopy = ValidateMoveOrCopy(copy);
var c = Services.ContentService.Copy(toCopy, copy.ParentId, copy.RelateToOriginal, copy.Recursive, Security.CurrentUser.Id);
var c = Services.ContentService.Copy(toCopy, copy.ParentId, copy.RelateToOriginal, copy.Recursive, Security.GetUserId().ResultOr(0));
var response = Request.CreateResponse(HttpStatusCode.OK);
response.Content = new StringContent(c.Path, Encoding.UTF8, "application/json");
@@ -1013,7 +1013,7 @@ namespace Umbraco.Web.Editors
if (foundContent == null)
HandleContentNotFound(id);
var unpublishResult = Services.ContentService.Unpublish(foundContent, culture: culture, userId: Security.CurrentUser.Id);
var unpublishResult = Services.ContentService.Unpublish(foundContent, culture: culture, userId: Security.GetUserId().ResultOr(0));
var content = MapToDisplay(foundContent, culture);

View File

@@ -50,36 +50,7 @@ namespace Umbraco.Web.Editors
Items = MapAvatarsAndNames(mapped)
};
}
[Obsolete("Use GetPagedLog instead")]
public IEnumerable<AuditLog> GetEntityLog(int id)
{
long totalRecords;
var result = Services.AuditService.GetPagedItemsByEntity(id, 1, int.MaxValue, out totalRecords);
return Mapper.Map<IEnumerable<AuditLog>>(result);
}
//TODO: Move to CurrentUserController?
[Obsolete("Use GetPagedCurrentUserLog instead")]
public IEnumerable<AuditLog> GetCurrentUserLog(AuditType logType, DateTime? sinceDate)
{
long totalRecords;
var dateQuery = sinceDate.HasValue ? SqlContext.Query<IAuditItem>().Where(x => x.CreateDate >= sinceDate) : null;
var userId = Security.GetUserId().ResultOr(0);
var result = Services.AuditService.GetPagedItemsByUser(userId, 1, int.MaxValue, out totalRecords, auditTypeFilter: new[] {logType},customFilter: dateQuery);
return Mapper.Map<IEnumerable<AuditLog>>(result);
}
[Obsolete("Use GetPagedLog instead")]
public IEnumerable<AuditLog> GetLog(AuditType logType, DateTime? sinceDate)
{
if (sinceDate == null)
sinceDate = DateTime.Now.Subtract(new TimeSpan(7, 0, 0, 0, 0));
return Mapper.Map<IEnumerable<AuditLog>>(
Services.AuditService.GetLogs(logType, sinceDate.Value));
}
private IEnumerable<AuditLog> MapAvatarsAndNames(IEnumerable<AuditLog> items)
{
var userIds = items.Select(x => x.UserId).ToArray();

View File

@@ -12,6 +12,7 @@ namespace Umbraco.Web.Routing
/// Provides an implementation of <see cref="IContentFinder"/> that handles page nice urls and a template.
/// </summary>
/// <remarks>
/// <para>This finder allows for an odd routing pattern similar to altTemplate, probably only use case is if there is an alternative mime type template and it should be routable by something like "/hello/world/json" where the JSON template is to be used for the "world" page</para>
/// <para>Handles <c>/foo/bar/template</c> where <c>/foo/bar</c> is the nice url of a document, and <c>template</c> a template alias.</para>
/// <para>If successful, then the template of the document request is also assigned.</para>
/// </remarks>

View File

@@ -173,7 +173,7 @@ namespace Umbraco.Web.Runtime
.Append<ContentFinderByPageIdQuery>()
.Append<ContentFinderByUrl>()
.Append<ContentFinderByIdPath>()
.Append<ContentFinderByUrlAndTemplate>()
//.Append<ContentFinderByUrlAndTemplate>() // disabled, this is an odd finder
.Append<ContentFinderByUrlAlias>()
.Append<ContentFinderByRedirectUrl>();

View File

@@ -175,7 +175,7 @@ namespace Umbraco.Web.Security
}
/// <summary>
/// Gets the currnet user's id.
/// Gets the current user's id.
/// </summary>
/// <returns></returns>
public virtual Attempt<int> GetUserId()