Merge branch 'netcore/netcore' into feature/8651-config-options-patten

# Conflicts:
#	src/Umbraco.Tests.Common/Builders/GlobalSettingsBuilder.cs
#	src/Umbraco.Tests/TEMP/DatabaseContextTests.sdf
#	src/Umbraco.Web.BackOffice/Controllers/ImagesController.cs
This commit is contained in:
Andy Butland
2020-08-27 09:03:01 +02:00
979 changed files with 9486 additions and 4278 deletions

View File

@@ -159,15 +159,15 @@ namespace Umbraco.Web.BackOffice.Controllers
[DetermineAmbiguousActionByPassingParameters]
public MediaItemDisplay GetById(int id)
{
var foundContent = GetObjectFromRequest(() => _mediaService.GetById(id));
var foundMedia = GetObjectFromRequest(() => _mediaService.GetById(id));
if (foundContent == null)
if (foundMedia == null)
{
HandleContentNotFound(id);
//HandleContentNotFound will throw an exception
return null;
}
return _umbracoMapper.Map<MediaItemDisplay>(foundContent);
return _umbracoMapper.Map<MediaItemDisplay>(foundMedia);
}
/// <summary>
@@ -180,15 +180,15 @@ namespace Umbraco.Web.BackOffice.Controllers
[DetermineAmbiguousActionByPassingParameters]
public MediaItemDisplay GetById(Guid id)
{
var foundContent = GetObjectFromRequest(() => _mediaService.GetById(id));
var foundMedia = GetObjectFromRequest(() => _mediaService.GetById(id));
if (foundContent == null)
if (foundMedia == null)
{
HandleContentNotFound(id);
//HandleContentNotFound will throw an exception
return null;
}
return _umbracoMapper.Map<MediaItemDisplay>(foundContent);
return _umbracoMapper.Map<MediaItemDisplay>(foundMedia);
}
/// <summary>
@@ -799,10 +799,13 @@ namespace Umbraco.Web.BackOffice.Controllers
var total = long.MaxValue;
while (page * pageSize < total)
{
var children = _mediaService.GetPagedChildren(mediaId, page, pageSize, out total,
var children = _mediaService.GetPagedChildren(mediaId, page++, pageSize, out total,
_sqlContext.Query<IMedia>().Where(x => x.Name == nameToFind));
foreach (var c in children)
return c; //return first one if any are found
var match = children.FirstOrDefault(c => c.ContentType.Alias == contentTypeAlias);
if (match != null)
{
return match;
}
}
return null;
}