Merge branch 'v8/contrib' into v8/dev

This commit is contained in:
Sebastiaan Janssen
2020-11-27 14:04:55 +01:00
22 changed files with 181 additions and 148 deletions

View File

@@ -2,7 +2,7 @@ name: "Code scanning - action"
on:
push:
branches: [v8/contrib,v8/dev]
branches: [v8/contrib,v8/dev,v8/bug,v8/feature]
pull_request:
# The branches below must be a subset of the branches above
schedule:

View File

@@ -1,4 +1,7 @@
name: "CodeQL config"
on:
push:
branches: [v8/contrib,v8/dev]
paths-ignore:
- node_modules
- Umbraco.TestData

View File

@@ -23,7 +23,6 @@ function runUnitTestServer() {
autoWatch: true,
port: 9999,
singleRun: false,
browsers: ['ChromeDebugging'],
keepalive: true
})
.start();

View File

@@ -6,11 +6,11 @@
* ===========
* This is now using Gulp 4, each child task is now a child function in its own corresponding file.
*
* To add a new task, simply add a new task file to gulp/tasks folder, add a require statement below to include the one or more methods
* To add a new task, simply add a new task file to gulp/tasks folder, add a require statement below to include the one or more methods
* and then add the exports command to add the new item into the task menu.
*/
const { src, dest, series, parallel, lastRun } = require('gulp');
const { series, parallel } = require('gulp');
const config = require('./gulp/config');
const { setDevelopmentMode, setTestMode } = require('./gulp/modes');
@@ -28,9 +28,9 @@ config.compile.current = config.compile.build;
// These Exports are the new way of defining Tasks in Gulp 4.x
// ***********************************************************
exports.build = series(parallel(dependencies, js, less, views), testUnit);
exports.dev = series(setDevelopmentMode, parallel(dependencies, js, less, views), watchTask);
exports.dev = series(setDevelopmentMode, parallel(dependencies, js, less, views), runUnitTestServer, watchTask);
exports.watch = series(watchTask);
//
//
exports.runTests = series(setTestMode, series(js, testUnit));
exports.runUnit = series(setTestMode, series(js, runUnitTestServer), watchTask);
exports.testE2e = series(setTestMode, parallel(testE2e));

View File

@@ -2,7 +2,7 @@
'use strict';
function ContentEditController($rootScope, $scope, $routeParams, $q, $window,
appState, contentResource, entityResource, navigationService, notificationsService,
appState, contentResource, entityResource, navigationService, notificationsService, contentAppHelper,
serverValidationManager, contentEditingHelper, localizationService, formHelper, umbRequestHelper,
editorState, $http, eventsService, overlayService, $location, localStorageService, treeService,
$exceptionHandler) {
@@ -282,7 +282,7 @@
$scope.page.saveButtonStyle = content.trashed || content.isElement || isBlueprint ? "primary" : "info";
// only create the save/publish/preview buttons if the
// content app is "Conent"
if ($scope.activeApp && $scope.activeApp.alias !== "umbContent" && $scope.activeApp.alias !== "umbInfo" && $scope.activeApp.alias !== "umbListView") {
if ($scope.activeApp && !contentAppHelper.isContentBasedApp($scope.activeApp)) {
$scope.defaultButton = null;
$scope.subButtons = null;
$scope.page.showSaveButton = false;

View File

@@ -24,7 +24,7 @@
controller: umbVariantContentController
};
function umbVariantContentController($scope) {
function umbVariantContentController($scope, contentAppHelper) {
var unsubscribe = [];
@@ -110,7 +110,7 @@
function onAppChanged(activeApp) {
// disable the name field if the active content app is not "Content" or "Info"
vm.nameDisabled = (activeApp && activeApp.alias !== "umbContent" && activeApp.alias !== "umbInfo" && activeApp.alias !== "umbListView");
vm.nameDisabled = (activeApp && !contentAppHelper.isContentBasedApp(activeApp));
}
/**

View File

@@ -0,0 +1,35 @@
/**
* @ngdoc service
* @name umbraco.services.contentAppHelper
* @description A helper service for content app related functions.
**/
function contentAppHelper() {
var service = {};
/**
* Default known content based apps.
*/
service.CONTENT_BASED_APPS = [ "umbContent", "umbInfo", "umbListView" ];
/**
* @ngdoc method
* @name umbraco.services.contentAppHelper#isContentBasedApp
* @methodOf umbraco.services.contentAppHelper
*
* @param {object} app A content app to check
*
* @description
* Determines whether the supplied content app is a known content based app
*
*/
service.isContentBasedApp = function (app) {
return service.CONTENT_BASED_APPS.indexOf(app.alias) !== -1;
}
return service;
}
angular.module('umbraco.services').factory('contentAppHelper', contentAppHelper);

View File

@@ -135,7 +135,7 @@ function treeService($q, treeResource, iconHelper, notificationsService, eventsS
if (treeNode.iconIsClass === undefined || treeNode.iconIsClass) {
var converted = iconHelper.convertFromLegacyTreeNodeIcon(treeNode);
treeNode.cssClass = standardCssClass + " " + converted;
if (converted.startsWith('.')) {
if (converted && converted.startsWith('.')) {
//its legacy so add some width/height
treeNode.style = "height:16px;width:16px;";
}

View File

@@ -28,8 +28,6 @@
.umb-node-preview__icon {
display: flex;
width: 25px;
min-height: 25px;
height: 100%;
justify-content: center;
align-items: center;

View File

@@ -1,6 +1,6 @@
<div>
<ng-form name="tabbedContentForm">
<div class="umb-group-panel" retrive-dom-element="registerPropertyGroup(element[0], attributes.appAnchor)" data-app-anchor="{{group.id}}" data-element="group-{{group.alias}}" ng-repeat="group in content.tabs track by group.label">
<div class="umb-group-panel" retrive-dom-element="registerPropertyGroup(element[0], attributes.appAnchor)" data-app-anchor="{{group.id}}" data-element="group-{{group.alias}}" ng-repeat="group in content.tabs track by group.id">
<div class="umb-group-panel__header">
<div id="group-{{group.id}}">{{ group.label }}</div>

View File

@@ -2,7 +2,7 @@
<ng-form name="elementTypeContentForm">
<div class="umb-group-panel"
data-element="group-{{group.alias}}"
ng-repeat="group in vm.model.variants[0].tabs track by group.label">
ng-repeat="group in vm.model.variants[0].tabs track by group.id">
<div class="umb-group-panel__header">
<div id="group-{{group.id}}">{{ group.label }}</div>

View File

@@ -1,7 +1,7 @@
<div class="umb-package-details">
<div class="umb-package-details__main-content">
<umb-box data-element="node-info-membership" ng-repeat="group in node.tabs| filter: {properties:{view:'readonlyvalue'}} track by group.label">
<umb-box data-element="node-info-membership" ng-repeat="group in node.tabs| filter: {properties:{view:'readonlyvalue'}} track by group.id">
<div class="umb-group-panel__header">
<div>{{ group.label }}</div>

View File

@@ -22,7 +22,7 @@
</label>
<umb-property-actions actions="vm.propertyActions"></umb-property-actions>
<umb-property-actions ng-if="!vm.showInherit" actions="vm.propertyActions"></umb-property-actions>
<small class="control-description" ng-if="vm.property.description" ng-bind-html="vm.property.description | preserveNewLineInHtml"></small>
</div>

View File

@@ -1,85 +1,75 @@
<div class="umb-node-preview" ng-class="{'umb-node-preview--sortable': sortable, 'umb-node-preview--unpublished': published === false }">
<div class="flex"> <!-- div keeps icon and nodename from wrapping -->
<umb-icon ng-if="icon" icon="{{icon}}" class="umb-node-preview__icon {{icon}}"></umb-icon>
<umb-icon ng-if="icon" icon="{{icon}}" class="umb-node-preview__icon"></umb-icon>
<div class="umb-node-preview__content">
<div class="umb-node-preview__name" ng-attr-title="{{nodeNameTitle}}">{{ name }}</div>
<div class="umb-node-preview__description" ng-if="description">{{ description }}</div>
<div class="umb-node-preview__name" ng-attr-title="{{nodeNameTitle}}">{{name}}</div>
<div class="umb-node-preview__description" ng-if="description">{{description}}</div>
<div class="umb-user-group-preview__permissions" ng-if="permissions">
<span>
<span class="bold"><localize key="general_rights">Permissions</localize>:</span>
<span ng-repeat="permission in permissions" class="umb-user-group-preview__permission">{{ permission.name }}</span>
<span ng-repeat="permission in permissions" class="umb-user-group-preview__permission">{{permission.name}}</span>
</span>
</div>
</div>
</div>
<div class="umb-node-preview__actions">
<!-- If editUrl has a value we render a link otherwise a button-->
<a
class="umb-node-preview__action"
title="Edit {{name}}"
ng-href="{{editUrl}}"
ng-if="allowEdit && editUrl"
ng-click="onEdit()"
>
<!-- If editUrl has a value we render a link otherwise a button -->
<a class="umb-node-preview__action"
title="Edit {{name}}"
ng-href="{{editUrl}}"
ng-if="allowEdit && editUrl"
ng-click="onEdit()">
<localize key="general_edit">Edit</localize>
<span class="sr-only">{{name}}</span>
</a>
<button
type="button"
class="umb-node-preview__action"
title="Edit {{name}}"
ng-if="allowEdit && !editUrl"
ng-click="onEdit()"
>
<button type="button"
class="umb-node-preview__action"
title="Edit {{name}}"
ng-if="allowEdit && !editUrl"
ng-click="onEdit()">
<localize key="general_edit">Edit</localize>
<span class="sr-only">{{name}}...</span>
</button>
<!-- If openUrl has a value we render a link otherwise a button-->
<a
class="umb-node-preview__action"
title="Open {{name}}"
ng-href="{{openUrl}}"
ng-if="allowOpen && openUrl"
ng-click="onOpen()"
>
<!-- If openUrl has a value we render a link otherwise a button -->
<a class="umb-node-preview__action"
title="Open {{name}}"
ng-href="{{openUrl}}"
ng-if="allowOpen && openUrl"
ng-click="onOpen()">
<localize key="general_open">Open</localize>
<span class="sr-only">{{name}}</span>
</a>
<button
type="button"
class="umb-node-preview__action"
title="Open {{name}}"
ng-if="allowOpen && !openUrl"
ng-click="onOpen()"
>
<button type="button"
class="umb-node-preview__action"
title="Open {{name}}"
ng-if="allowOpen && !openUrl"
ng-click="onOpen()">
<localize key="general_open">Open</localize>
<span class="sr-only">{{name}}...</span>
</button>
<!-- If removeUrl has a value we render a link otherwise a button-->
<a
class="umb-node-preview__action umb-node-preview__action--red"
title="Remove {{name}}"
ng-href="{{removeUrl}}"
ng-if="allowRemove && removeUrl"
ng-click="onRemove()"
>
<!-- If removeUrl has a value we render a link otherwise a button -->
<a class="umb-node-preview__action umb-node-preview__action--red"
title="Remove {{name}}"
ng-href="{{removeUrl}}"
ng-if="allowRemove && removeUrl"
ng-click="onRemove()">
<localize key="general_remove">Remove</localize>
<span class="sr-only">{{name}}</span>
</a>
<button
type="button"
class="umb-node-preview__action umb-node-preview__action--red"
title="Remove {{name}}"
ng-if="allowRemove && !removeUrl"
ng-click="onRemove()"
>
<button type="button"
class="umb-node-preview__action umb-node-preview__action--red"
title="Remove {{name}}"
ng-if="allowRemove && !removeUrl"
ng-click="onRemove()">
<localize key="general_remove">Remove</localize>
<span class="sr-only">{{name}}</span>
</button>

View File

@@ -12,7 +12,7 @@ function DictionaryCreateController($scope, $location, dictionaryResource, navig
vm.itemKey = "";
vm.createItem = createItem;
$scope.$emit("$changeTitle", "");
function createItem() {
if (formHelper.submitForm({ scope: $scope, formCtrl: $scope.createDictionaryForm })) {

View File

@@ -1,5 +1,5 @@
<div class="form-horizontal" ng-controller="Umbraco.Editors.Media.Apps.ContentController as vm">
<div class="umb-group-panel" data-element="group-{{group.alias}}" ng-repeat="group in content.tabs | filter: { hide : '!' + true } track by group.label">
<div class="umb-group-panel" data-element="group-{{group.alias}}" ng-repeat="group in content.tabs | filter: { hide : '!' + true } track by group.id">
<div class="umb-group-panel__header">
<div>{{ group.label }}</div>

View File

@@ -1,6 +1,6 @@
<div class="form-horizontal" ng-controller="Umbraco.Editors.Member.Apps.ContentController as vm">
<div class="umb-group-panel" ng-repeat="group in content.tabs track by group.label">
<div class="umb-group-panel" ng-repeat="group in content.tabs track by group.id">
<div class="umb-group-panel__header">
<div>{{ group.label }}</div>

View File

@@ -17,20 +17,20 @@
<li ng-repeat="template in model.value.templates" class="clearfix">
<div ng-click="vm.configureTemplate(template)" class="preview-rows layout">
<button type="button" ng-click="vm.configureTemplate(template)" class="btn-reset preview-rows layout">
<div class="preview-row">
<div class="preview-col"
<span class="preview-row">
<span class="preview-col"
ng-class="{last:$last}"
ng-repeat="section in template.sections | filter: vm.zeroWidthFilter"
ng-style="{width: vm.percentage(section.grid) + '%', height: '60px', 'max-width': '100%'}">
<div class="preview-cell"></div>
</div>
</div>
</div>
<span class="preview-cell"></span>
</span>
</span>
</button>
<div>
{{template.name}} <br />
<p>{{template.name}}</p>
<button type="button" class="btn btn-small btn-link" ng-click="vm.deleteTemplate($index)">
<i class="icon-delete red" aria-hidden="true"></i>
<localize key="general_delete">Delete</localize>
@@ -42,7 +42,7 @@
<button type="button" class="btn btn-small btn-info" ng-click="vm.configureTemplate()">
<i class="icon-add" aria-hidden="true"></i>
<localize key="grid_addGridLayout" />
<localize key="grid_addGridLayout">Add Grid Layout</localize>
</button>
</div>
</div>
@@ -64,23 +64,23 @@
<li ng-repeat="layout in model.value.layouts" class="clearfix">
<div ng-click="vm.configureLayout(layout)" class="preview-rows columns">
<button type="button" ng-click="vm.configureLayout(layout)" class="btn-reset preview-rows columns">
<div class="preview-row">
<div class="preview-col"
<span class="preview-row">
<span class="preview-col"
ng-class="{last:$last}"
ng-repeat="area in layout.areas | filter: vm.zeroWidthFilter"
ng-style="{width: vm.percentage(area.grid) + '%', 'max-width': '100%'}">
<div class="preview-cell">
<p ng-show="area.maxItems > 0">{{area.maxItems}}</p>
</div>
</div>
</div>
</div>
<span class="preview-cell">
<span ng-show="area.maxItems > 0">{{area.maxItems}}</span>
</span>
</span>
</span>
</button>
<div>
{{layout.label || layout.name}}<br />
<p>{{layout.label || layout.name}}</p>
<button type="button" class="btn btn-small btn-link" ng-click="vm.deleteLayout(layout, $index, $event)">
<i class="icon-delete red" aria-hidden="true"></i>
<localize key="general_delete">Delete</localize>
@@ -126,7 +126,7 @@
</ul>
<ul class="unstyled list-icons">
<li>
<li>
<button type="button" ng-click="vm.editConfig()" class="btn-link">
<i class="icon icon-settings-alt-2 turquoise" aria-hidden="true"></i>
<localize key="general_edit">Edit</localize>
@@ -155,7 +155,7 @@
</ul>
<ul class="unstyled list-icons">
<li>
<li>
<button type="button" ng-click="vm.editStyles()" class="btn-link">
<i class="icon icon-settings-alt-2 turquoise" aria-hidden="true"></i>
<localize key="general_edit">Edit</localize>

View File

@@ -4,17 +4,24 @@ function iconPreValsController($scope, editorService) {
$scope.model.value = "icon-list";
}
let valueArray = $scope.model.value.split(' ');
$scope.icon = valueArray[0];
$scope.color = valueArray[1];
$scope.openIconPicker = function () {
var iconPicker = {
icon: $scope.model.value.split(' ')[0],
color: $scope.model.value.split(' ')[1],
icon: $scope.icon,
color: $scope.color,
submit: function (model) {
if (model.icon) {
if (model.color) {
$scope.model.value = model.icon + " " + model.color;
$scope.color = model.color;
} else {
$scope.model.value = model.icon;
}
}
$scope.icon = model.icon;
$scope.iconForm.$setDirty();
}
editorService.close();

View File

@@ -1,11 +1,11 @@
<div ng-controller="Umbraco.PrevalueEditors.IconPickerController">
<ng-form data-element="editor-icon" name="iconForm">
<div class="umb-panel-header-icon" ng-if="!hideIcon" ng-click="openIconPicker()" ng-class="{'-placeholder': model.value==='' || model.value===null}"
<button type="button" class="btn-reset umb-panel-header-icon" ng-if="!hideIcon" ng-click="openIconPicker()" ng-class="{'-placeholder': model.value==='' || model.value===null}"
title="{{model.value}}">
<i class="icon {{model.value}}" aria-hidden="true" ng-if="model.value!=='' && model.value!==null"></i>
<div class="umb-panel-header-icon-text" ng-if="model.value==='' || model.value===null">
<localize key="settings_addIcon"></localize>
</div>
</div>
<umb-icon icon="{{icon}}" class="{{color}}" ng-if="model.value !== '' && model.value !== null"></umb-icon>
<span class="umb-panel-header-icon-text" ng-if="model.value === '' || model.value === null">
<localize key="settings_addIcon">Add icon</localize>
</span>
</button>
</ng-form>
</div>

View File

@@ -33,15 +33,16 @@ namespace Umbraco.Web.PublishedCache.NuCache
_urlSegment = ContentData.UrlSegment;
IsPreviewing = ContentData.Published == false;
var properties = new List<IPublishedProperty>();
var properties = new IPublishedProperty[_contentNode.ContentType.PropertyTypes.Count()];
int i =0;
foreach (var propertyType in _contentNode.ContentType.PropertyTypes)
{
// add one property per property type - this is required, for the indexing to work
// if contentData supplies pdatas, use them, else use null
contentData.Properties.TryGetValue(propertyType.Alias, out var pdatas); // else will be null
properties.Add(new Property(propertyType, this, pdatas, _publishedSnapshotAccessor));
properties[i++] =new Property(propertyType, this, pdatas, _publishedSnapshotAccessor);
}
PropertiesArray = properties.ToArray();
PropertiesArray = properties;
}
private string GetProfileNameById(int id)

View File

@@ -141,7 +141,7 @@ namespace Umbraco.Web
/// <returns></returns>
public IHtmlString RenderTemplate(int contentId, int? altTemplateId = null)
{
return ComponentRenderer.RenderTemplate(contentId, altTemplateId);
return _componentRenderer.RenderTemplate(contentId, altTemplateId);
}
#region RenderMacro
@@ -153,7 +153,7 @@ namespace Umbraco.Web
/// <returns></returns>
public IHtmlString RenderMacro(string alias)
{
return ComponentRenderer.RenderMacro(AssignedContentItem?.Id ?? 0, alias, null);
return _componentRenderer.RenderMacro(AssignedContentItem?.Id ?? 0, alias, null);
}
/// <summary>
@@ -164,7 +164,7 @@ namespace Umbraco.Web
/// <returns></returns>
public IHtmlString RenderMacro(string alias, object parameters)
{
return ComponentRenderer.RenderMacro(AssignedContentItem?.Id ?? 0, alias, parameters?.ToDictionary<object>());
return _componentRenderer.RenderMacro(AssignedContentItem?.Id ?? 0, alias, parameters?.ToDictionary<object>());
}
/// <summary>
@@ -175,7 +175,7 @@ namespace Umbraco.Web
/// <returns></returns>
public IHtmlString RenderMacro(string alias, IDictionary<string, object> parameters)
{
return ComponentRenderer.RenderMacro(AssignedContentItem?.Id ?? 0, alias, parameters);
return _componentRenderer.RenderMacro(AssignedContentItem?.Id ?? 0, alias, parameters);
}
#endregion
@@ -212,7 +212,7 @@ namespace Umbraco.Web
/// Returns the ICultureDictionary for access to dictionary items
/// </summary>
public ICultureDictionary CultureDictionary => _cultureDictionary
?? (_cultureDictionary = CultureDictionaryFactory.CreateDictionary());
?? (_cultureDictionary = _cultureDictionaryFactory.CreateDictionary());
#endregion
@@ -225,7 +225,7 @@ namespace Umbraco.Web
/// <returns>True if the current user has access or if the current document isn't protected</returns>
public bool MemberHasAccess(string path)
{
return MembershipHelper.MemberHasAccess(path);
return _membershipHelper.MemberHasAccess(path);
}
/// <summary>
@@ -234,7 +234,7 @@ namespace Umbraco.Web
/// <returns>True is the current user is logged in</returns>
public bool MemberIsLoggedOn()
{
return MembershipHelper.IsLoggedIn();
return _membershipHelper.IsLoggedIn();
}
#endregion
@@ -275,7 +275,7 @@ namespace Umbraco.Web
public IPublishedContent Member(Guid id)
{
return MembershipHelper.GetById(id);
return _membershipHelper.GetById(id);
}
public IPublishedContent Member(object id)
@@ -291,18 +291,18 @@ namespace Umbraco.Web
public IPublishedContent Member(int id)
{
return MembershipHelper.GetById(id);
return _membershipHelper.GetById(id);
}
public IPublishedContent Member(string id)
{
var asInt = id.TryConvertTo<int>();
return asInt ? MembershipHelper.GetById(asInt.Result) : MembershipHelper.GetByProviderKey(id);
return asInt ? _membershipHelper.GetById(asInt.Result) : _membershipHelper.GetByProviderKey(id);
}
public IEnumerable<IPublishedContent> Members(IEnumerable<int> ids)
{
return MembershipHelper.GetByIds(ids);
return _membershipHelper.GetByIds(ids);
}
public IEnumerable<IPublishedContent> Members(IEnumerable<string> ids)
@@ -312,7 +312,7 @@ namespace Umbraco.Web
public IEnumerable<IPublishedContent> Members(IEnumerable<Guid> ids)
{
return MembershipHelper.GetByIds(ids);
return _membershipHelper.GetByIds(ids);
}
public IEnumerable<IPublishedContent> Members(IEnumerable<Udi> ids)
@@ -337,7 +337,7 @@ namespace Umbraco.Web
public IEnumerable<IPublishedContent> Members(params Guid[] ids)
{
return MembershipHelper.GetByIds(ids);
return _membershipHelper.GetByIds(ids);
}
public IEnumerable<IPublishedContent> Members(params Udi[] ids)
@@ -367,11 +367,11 @@ namespace Umbraco.Web
private IPublishedContent ContentForObject(object id)
{
if (ConvertIdObjectToInt(id, out var intId))
return ContentQuery.Content(intId);
return _publishedContentQuery.Content(intId);
if (ConvertIdObjectToGuid(id, out var guidId))
return ContentQuery.Content(guidId);
return _publishedContentQuery.Content(guidId);
if (ConvertIdObjectToUdi(id, out var udiId))
return ContentQuery.Content(udiId);
return _publishedContentQuery.Content(udiId);
return null;
}
@@ -382,7 +382,7 @@ namespace Umbraco.Web
/// <returns>The content, or null of the content item is not in the cache.</returns>
public IPublishedContent Content(int id)
{
return ContentQuery.Content(id);
return _publishedContentQuery.Content(id);
}
/// <summary>
@@ -392,7 +392,7 @@ namespace Umbraco.Web
/// <returns>The content, or null of the content item is not in the cache.</returns>
public IPublishedContent Content(Guid id)
{
return ContentQuery.Content(id);
return _publishedContentQuery.Content(id);
}
/// <summary>
@@ -407,12 +407,12 @@ namespace Umbraco.Web
public IPublishedContent Content(Udi id)
{
return ContentQuery.Content(id);
return _publishedContentQuery.Content(id);
}
public IPublishedContent ContentSingleAtXPath(string xpath, params XPathVariable[] vars)
{
return ContentQuery.ContentSingleAtXPath(xpath, vars);
return _publishedContentQuery.ContentSingleAtXPath(xpath, vars);
}
/// <summary>
@@ -434,7 +434,7 @@ namespace Umbraco.Web
/// <remarks>If an identifier does not match an existing content, it will be missing in the returned value.</remarks>
public IEnumerable<IPublishedContent> Content(params Udi[] ids)
{
return ids.Select(id => ContentQuery.Content(id)).WhereNotNull();
return ids.Select(id => _publishedContentQuery.Content(id)).WhereNotNull();
}
/// <summary>
@@ -445,16 +445,16 @@ namespace Umbraco.Web
/// <remarks>If an identifier does not match an existing content, it will be missing in the returned value.</remarks>
public IEnumerable<IPublishedContent> Content(params GuidUdi[] ids)
{
return ids.Select(id => ContentQuery.Content(id));
return ids.Select(id => _publishedContentQuery.Content(id));
}
private IEnumerable<IPublishedContent> ContentForObjects(IEnumerable<object> ids)
{
var idsA = ids.ToArray();
if (ConvertIdsObjectToInts(idsA, out var intIds))
return ContentQuery.Content(intIds);
return _publishedContentQuery.Content(intIds);
if (ConvertIdsObjectToGuids(idsA, out var guidIds))
return ContentQuery.Content(guidIds);
return _publishedContentQuery.Content(guidIds);
return Enumerable.Empty<IPublishedContent>();
}
@@ -465,7 +465,7 @@ namespace Umbraco.Web
/// <returns>The content items that were found in the cache.</returns>
public IEnumerable<IPublishedContent> Content(params int[] ids)
{
return ContentQuery.Content(ids);
return _publishedContentQuery.Content(ids);
}
/// <summary>
@@ -475,7 +475,7 @@ namespace Umbraco.Web
/// <returns>The content items that were found in the cache.</returns>
public IEnumerable<IPublishedContent> Content(params Guid[] ids)
{
return ContentQuery.Content(ids);
return _publishedContentQuery.Content(ids);
}
/// <summary>
@@ -507,7 +507,7 @@ namespace Umbraco.Web
/// <remarks>If an identifier does not match an existing content, it will be missing in the returned value.</remarks>
public IEnumerable<IPublishedContent> Content(IEnumerable<Udi> ids)
{
return ids.Select(id => ContentQuery.Content(id)).WhereNotNull();
return ids.Select(id => _publishedContentQuery.Content(id)).WhereNotNull();
}
/// <summary>
@@ -518,7 +518,7 @@ namespace Umbraco.Web
/// <remarks>If an identifier does not match an existing content, it will be missing in the returned value.</remarks>
public IEnumerable<IPublishedContent> Content(IEnumerable<GuidUdi> ids)
{
return ids.Select(id => ContentQuery.Content(id));
return ids.Select(id => _publishedContentQuery.Content(id));
}
/// <summary>
@@ -540,22 +540,22 @@ namespace Umbraco.Web
/// <remarks>If an identifier does not match an existing content, it will be missing in the returned value.</remarks>
public IEnumerable<IPublishedContent> Content(IEnumerable<int> ids)
{
return ContentQuery.Content(ids);
return _publishedContentQuery.Content(ids);
}
public IEnumerable<IPublishedContent> ContentAtXPath(string xpath, params XPathVariable[] vars)
{
return ContentQuery.ContentAtXPath(xpath, vars);
return _publishedContentQuery.ContentAtXPath(xpath, vars);
}
public IEnumerable<IPublishedContent> ContentAtXPath(XPathExpression xpath, params XPathVariable[] vars)
{
return ContentQuery.ContentAtXPath(xpath, vars);
return _publishedContentQuery.ContentAtXPath(xpath, vars);
}
public IEnumerable<IPublishedContent> ContentAtRoot()
{
return ContentQuery.ContentAtRoot();
return _publishedContentQuery.ContentAtRoot();
}
internal static bool ConvertIdObjectToInt(object id, out int intId)
@@ -654,7 +654,7 @@ namespace Umbraco.Web
public IPublishedContent Media(Guid id)
{
return ContentQuery.Media(id);
return _publishedContentQuery.Media(id);
}
/// <summary>
@@ -675,17 +675,17 @@ namespace Umbraco.Web
private IPublishedContent MediaForObject(object id)
{
if (ConvertIdObjectToInt(id, out var intId))
return ContentQuery.Media(intId);
return _publishedContentQuery.Media(intId);
if (ConvertIdObjectToGuid(id, out var guidId))
return ContentQuery.Media(guidId);
return _publishedContentQuery.Media(guidId);
if (ConvertIdObjectToUdi(id, out var udiId))
return ContentQuery.Media(udiId);
return _publishedContentQuery.Media(udiId);
return null;
}
public IPublishedContent Media(int id)
{
return ContentQuery.Media(id);
return _publishedContentQuery.Media(id);
}
public IPublishedContent Media(string id)
@@ -708,9 +708,9 @@ namespace Umbraco.Web
{
var idsA = ids.ToArray();
if (ConvertIdsObjectToInts(idsA, out var intIds))
return ContentQuery.Media(intIds);
return _publishedContentQuery.Media(intIds);
if (ConvertIdsObjectToGuids(idsA, out var guidIds))
return ContentQuery.Media(guidIds);
return _publishedContentQuery.Media(guidIds);
return Enumerable.Empty<IPublishedContent>();
}
@@ -722,7 +722,7 @@ namespace Umbraco.Web
/// <remarks>If an identifier does not match an existing media, it will be missing in the returned value.</remarks>
public IEnumerable<IPublishedContent> Media(params int[] ids)
{
return ContentQuery.Media(ids);
return _publishedContentQuery.Media(ids);
}
/// <summary>
@@ -745,7 +745,7 @@ namespace Umbraco.Web
/// <remarks>If an identifier does not match an existing media, it will be missing in the returned value.</remarks>
public IEnumerable<IPublishedContent> Media(params Udi[] ids)
{
return ids.Select(id => ContentQuery.Media(id)).WhereNotNull();
return ids.Select(id => _publishedContentQuery.Media(id)).WhereNotNull();
}
/// <summary>
@@ -756,7 +756,7 @@ namespace Umbraco.Web
/// <remarks>If an identifier does not match an existing media, it will be missing in the returned value.</remarks>
public IEnumerable<IPublishedContent> Media(params GuidUdi[] ids)
{
return ids.Select(id => ContentQuery.Media(id));
return ids.Select(id => _publishedContentQuery.Media(id));
}
/// <summary>
@@ -778,7 +778,7 @@ namespace Umbraco.Web
/// <remarks>If an identifier does not match an existing media, it will be missing in the returned value.</remarks>
public IEnumerable<IPublishedContent> Media(IEnumerable<int> ids)
{
return ContentQuery.Media(ids);
return _publishedContentQuery.Media(ids);
}
/// <summary>
@@ -789,7 +789,7 @@ namespace Umbraco.Web
/// <remarks>If an identifier does not match an existing media, it will be missing in the returned value.</remarks>
public IEnumerable<IPublishedContent> Media(IEnumerable<Udi> ids)
{
return ids.Select(id => ContentQuery.Media(id)).WhereNotNull();
return ids.Select(id => _publishedContentQuery.Media(id)).WhereNotNull();
}
/// <summary>
@@ -800,7 +800,7 @@ namespace Umbraco.Web
/// <remarks>If an identifier does not match an existing media, it will be missing in the returned value.</remarks>
public IEnumerable<IPublishedContent> Media(IEnumerable<GuidUdi> ids)
{
return ids.Select(id => ContentQuery.Media(id));
return ids.Select(id => _publishedContentQuery.Media(id));
}
/// <summary>
@@ -816,7 +816,7 @@ namespace Umbraco.Web
public IEnumerable<IPublishedContent> MediaAtRoot()
{
return ContentQuery.MediaAtRoot();
return _publishedContentQuery.MediaAtRoot();
}
#endregion