.ThrowOnWarning = false;
+
base.TearDown();
}
@@ -762,16 +766,26 @@ namespace Umbraco.Tests.Services
var parent = ServiceContext.ContentService.GetById(NodeDto.NodeIdSeed + 1);
ServiceContext.ContentService.Publish(parent);//Publishing root, so Text Page 2 can be updated.
var subpage2 = contentService.GetById(NodeDto.NodeIdSeed + 3);
+
subpage2.Name = "Text Page 2 Updated";
subpage2.SetValue("author", "Jane Doe");
contentService.SaveAndPublishWithStatus(subpage2, 0);//NOTE New versions are only added between publish-state-changed, so publishing to ensure addition version.
+ subpage2.Name = "Text Page 2 Updated again";
+ subpage2.SetValue("author", "Bob Hope");
+ contentService.SaveAndPublishWithStatus(subpage2, 0);//NOTE New versions are only added between publish-state-changed, so publishing to ensure addition version.
+
// Act
var versions = contentService.GetVersions(NodeDto.NodeIdSeed + 3).ToList();
// Assert
Assert.That(versions.Any(), Is.True);
Assert.That(versions.Count(), Is.GreaterThanOrEqualTo(2));
+
+ //ensure each version contains the correct property values
+ Assert.AreEqual("John Doe", versions[2].GetValue("author"));
+ Assert.AreEqual("Jane Doe", versions[1].GetValue("author"));
+ Assert.AreEqual("Bob Hope", versions[0].GetValue("author"));
}
[Test]
diff --git a/src/Umbraco.Tests/Services/MediaServiceTests.cs b/src/Umbraco.Tests/Services/MediaServiceTests.cs
index eec1f7ac6f..d9ecc66e8f 100644
--- a/src/Umbraco.Tests/Services/MediaServiceTests.cs
+++ b/src/Umbraco.Tests/Services/MediaServiceTests.cs
@@ -7,6 +7,7 @@ using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Rdbms;
using Umbraco.Core.Persistence;
+using Umbraco.Core.Persistence.DatabaseModelDefinitions;
using Umbraco.Core.Persistence.Repositories;
using Umbraco.Core.Persistence.UnitOfWork;
using Umbraco.Tests.TestHelpers;
@@ -30,6 +31,33 @@ namespace Umbraco.Tests.Services
base.TearDown();
}
+ [Test]
+ public void Get_Paged_Children_With_Media_Type_Filter()
+ {
+ var mediaService = ServiceContext.MediaService;
+ var mediaType1 = MockedContentTypes.CreateImageMediaType("Image2");
+ ServiceContext.ContentTypeService.Save(mediaType1);
+ var mediaType2 = MockedContentTypes.CreateImageMediaType("Image3");
+ ServiceContext.ContentTypeService.Save(mediaType2);
+
+ for (int i = 0; i < 10; i++)
+ {
+ var m1 = MockedMedia.CreateMediaImage(mediaType1, -1);
+ mediaService.Save(m1);
+ var m2 = MockedMedia.CreateMediaImage(mediaType2, -1);
+ mediaService.Save(m2);
+ }
+
+ long total;
+ var result = ServiceContext.MediaService.GetPagedChildren(-1, 0, 11, out total, "SortOrder", Direction.Ascending, true, null, new[] {mediaType1.Id, mediaType2.Id});
+ Assert.AreEqual(11, result.Count());
+ Assert.AreEqual(20, total);
+
+ result = ServiceContext.MediaService.GetPagedChildren(-1, 1, 11, out total, "SortOrder", Direction.Ascending, true, null, new[] { mediaType1.Id, mediaType2.Id });
+ Assert.AreEqual(9, result.Count());
+ Assert.AreEqual(20, total);
+ }
+
[Test]
public void Can_Move_Media()
{
diff --git a/src/Umbraco.Tests/Umbraco.Tests.csproj b/src/Umbraco.Tests/Umbraco.Tests.csproj
index d6f2393c13..eb126eb68e 100644
--- a/src/Umbraco.Tests/Umbraco.Tests.csproj
+++ b/src/Umbraco.Tests/Umbraco.Tests.csproj
@@ -159,6 +159,7 @@
+
@@ -170,6 +171,7 @@
+
diff --git a/src/Umbraco.Web.UI.Client/src/common/resources/media.resource.js b/src/Umbraco.Web.UI.Client/src/common/resources/media.resource.js
index bbb78cd616..d1810f56ee 100644
--- a/src/Umbraco.Web.UI.Client/src/common/resources/media.resource.js
+++ b/src/Umbraco.Web.UI.Client/src/common/resources/media.resource.js
@@ -427,7 +427,9 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
* Retrieves all media children with types used as folders.
* Uses the convention of looking for media items with mediaTypes ending in
* *Folder so will match "Folder", "bannerFolder", "secureFolder" etc,
- *
+ *
+ * NOTE: This will return a max of 500 folders, if more is required it needs to be paged
+ *
* ##usage
*
* mediaResource.getChildFolders(1234)
@@ -445,14 +447,15 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
parentId = -1;
}
+ //NOTE: This will return a max of 500 folders, if more is required it needs to be paged
return umbRequestHelper.resourcePromise(
$http.get(
umbRequestHelper.getApiUrl(
"mediaApiBaseUrl",
"GetChildFolders",
- [
- { id: parentId }
- ])),
+ {
+ id: parentId
+ })),
'Failed to retrieve child folders for media item ' + parentId);
},
diff --git a/src/Umbraco.Web.UI.Client/src/common/security/securityinterceptor.js b/src/Umbraco.Web.UI.Client/src/common/security/securityinterceptor.js
index e47f0663d8..0c18656c83 100644
--- a/src/Umbraco.Web.UI.Client/src/common/security/securityinterceptor.js
+++ b/src/Umbraco.Web.UI.Client/src/common/security/securityinterceptor.js
@@ -19,15 +19,20 @@ angular.module('umbraco.security.interceptor')
return promise;
}, function(originalResponse) {
// Intercept failed requests
+
+ // Make sure we have the configuration of the request (don't we always?)
+ var config = originalResponse.config ? originalResponse.config : {};
+
+ // Make sure we have an object for the headers of the request
+ var headers = config.headers ? config.headers : {};
- //Here we'll check if we should ignore the error, this will be based on an original header set
- var headers = originalResponse.config ? originalResponse.config.headers : {};
- if (headers["x-umb-ignore-error"] === "ignore") {
+ //Here we'll check if we should ignore the error (either based on the original header set or the request configuration)
+ if (headers["x-umb-ignore-error"] === "ignore" || config.umbIgnoreErrors === true) {
//exit/ignore
return promise;
}
var filtered = _.find(requestInterceptorFilter(), function(val) {
- return originalResponse.config.url.indexOf(val) > 0;
+ return config.url.indexOf(val) > 0;
});
if (filtered) {
return promise;
@@ -99,4 +104,4 @@ angular.module('umbraco.security.interceptor')
// We have to add the interceptor to the queue as a string because the interceptor depends upon service instances that are not available in the config block.
.config(['$httpProvider', function ($httpProvider) {
$httpProvider.responseInterceptors.push('securityInterceptor');
- }]);
\ No newline at end of file
+ }]);
diff --git a/src/Umbraco.Web.UI.Client/src/common/services/mediatypehelper.service.js b/src/Umbraco.Web.UI.Client/src/common/services/mediatypehelper.service.js
index 20e5e3799b..b06a5ca8e3 100644
--- a/src/Umbraco.Web.UI.Client/src/common/services/mediatypehelper.service.js
+++ b/src/Umbraco.Web.UI.Client/src/common/services/mediatypehelper.service.js
@@ -7,6 +7,19 @@ function mediaTypeHelper(mediaTypeResource, $q) {
var mediaTypeHelperService = {
+ isFolderType: function(mediaEntity) {
+ if (!mediaEntity) {
+ throw "mediaEntity is null";
+ }
+ if (!mediaEntity.contentTypeAlias) {
+ throw "mediaEntity.contentTypeAlias is null";
+ }
+
+ //if you create a media type, which has an alias that ends with ...Folder then its a folder: ex: "secureFolder", "bannerFolder", "Folder"
+ //this is the exact same logic that is performed in MediaController.GetChildFolders
+ return mediaEntity.contentTypeAlias.endsWith("Folder");
+ },
+
getAllowedImagetypes: function (mediaId){
// Get All allowedTypes
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts/grid/grid.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts/grid/grid.html
index 16c5efe799..d09b04f97a 100644
--- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts/grid/grid.html
+++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts/grid/grid.html
@@ -51,7 +51,7 @@
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts/grid/grid.listviewlayout.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts/grid/grid.listviewlayout.controller.js
index be1c5856ae..b8ba4f880b 100644
--- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts/grid/grid.listviewlayout.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts/grid/grid.listviewlayout.controller.js
@@ -37,7 +37,8 @@
function activate() {
vm.itemsWithoutFolders = filterOutFolders($scope.items);
- if($scope.entityType === 'media') {
+ //no need to make another REST/DB call if this data is not used when we are browsing the bin
+ if ($scope.entityType === 'media' && !vm.isRecycleBin) {
mediaTypeHelper.getAllowedImagetypes(vm.nodeId).then(function (types) {
vm.acceptedMediatypes = types;
});
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js
index 8542157607..a9eab75a04 100644
--- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js
@@ -53,7 +53,9 @@ function listViewController($rootScope, $scope, $routeParams, $injector, $cookie
$scope.isNew = false;
$scope.actionInProgress = false;
$scope.selection = [];
- $scope.folders = [];
+ $scope.folders = [];
+ //tracks if we've already loaded the folders for the current node
+ var foldersLoaded = false;
$scope.listViewResultSet = {
totalPages: 0,
items: []
@@ -268,12 +270,13 @@ function listViewController($rootScope, $scope, $routeParams, $injector, $cookie
});
}
- if ($scope.entityType === 'media') {
-
+ if (!foldersLoaded && $scope.entityType === 'media') {
+ //The folders aren't loaded - we only need to do this once since we're never changing node ids
mediaResource.getChildFolders($scope.contentId)
.then(function (folders) {
$scope.folders = folders;
$scope.viewLoaded = true;
+ foldersLoaded = true;
});
} else {
diff --git a/src/Umbraco.Web.UI/config/umbracoSettings.Release.config b/src/Umbraco.Web.UI/config/umbracoSettings.Release.config
index 1dc6f8aae1..846622843b 100644
--- a/src/Umbraco.Web.UI/config/umbracoSettings.Release.config
+++ b/src/Umbraco.Web.UI/config/umbracoSettings.Release.config
@@ -51,7 +51,7 @@
throw
- ashx,aspx,ascx,config,cshtml,vbhtml,asmx,air,axd,swf,xml,html,htm,svg,php,htaccess
+ ashx,aspx,ascx,config,cshtml,vbhtml,asmx,air,axd,swf,xml,xhtml,html,htm,svg,php,htaccess
Textstring
diff --git a/src/Umbraco.Web.UI/config/umbracoSettings.config b/src/Umbraco.Web.UI/config/umbracoSettings.config
index 42e21e1b3d..429cc30d20 100644
--- a/src/Umbraco.Web.UI/config/umbracoSettings.config
+++ b/src/Umbraco.Web.UI/config/umbracoSettings.config
@@ -100,7 +100,7 @@
throw
- ashx,aspx,ascx,config,cshtml,vbhtml,asmx,air,axd,swf,xml,html,htm,svg,php,htaccess
+ ashx,aspx,ascx,config,cshtml,vbhtml,asmx,air,axd,swf,xml,xhtml,html,htm,svg,php,htaccess
Textstring
diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/sv.xml b/src/Umbraco.Web.UI/umbraco/config/lang/sv.xml
index 259b914a72..aeaf8bd49b 100644
--- a/src/Umbraco.Web.UI/umbraco/config/lang/sv.xml
+++ b/src/Umbraco.Web.UI/umbraco/config/lang/sv.xml
@@ -87,7 +87,7 @@
Välj aktuell mapp
Förhandsgranska
Förhandsgranskning är avstängt på grund av att det inte finns någon mall tilldelad
- Ångra
+ Annat
Välj stil
Visa stil
Infoga tabell
@@ -171,6 +171,7 @@
"dokumenttyper".]]>
"mediatyper".]]>
Välj typ och rubrik
+ Dokumenttyp utan sidmall
Surfa på din webbplats
@@ -936,4 +937,4 @@
Översättare
Din profil
-
\ No newline at end of file
+
diff --git a/src/Umbraco.Web/Editors/EntityController.cs b/src/Umbraco.Web/Editors/EntityController.cs
index f5af30a57f..1bb0cdfdf6 100644
--- a/src/Umbraco.Web/Editors/EntityController.cs
+++ b/src/Umbraco.Web/Editors/EntityController.cs
@@ -5,30 +5,17 @@ using System.Globalization;
using System.Net;
using System.Text;
using System.Web.Http;
-using System.Web.Http.ModelBinding;
using AutoMapper;
-using ClientDependency.Core;
-using Examine.LuceneEngine;
-using Examine.LuceneEngine.Providers;
-using Newtonsoft.Json;
using Umbraco.Core;
-using Umbraco.Core.Logging;
using Umbraco.Core.Models.Membership;
-using Umbraco.Core.Services;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Mvc;
using System.Linq;
using System.Net.Http;
-using Umbraco.Core.Models.EntityBase;
using Umbraco.Core.Models;
-using Umbraco.Web.WebApi.Filters;
-using umbraco.cms.businesslogic.packager;
using Constants = Umbraco.Core.Constants;
using Examine;
-using Examine.LuceneEngine.SearchCriteria;
-using Examine.SearchCriteria;
using Umbraco.Web.Dynamics;
-using umbraco;
using System.Text.RegularExpressions;
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
using System.Web.Http.Controllers;
diff --git a/src/Umbraco.Web/Editors/MediaController.cs b/src/Umbraco.Web/Editors/MediaController.cs
index 3db1656c34..64c619ee6f 100644
--- a/src/Umbraco.Web/Editors/MediaController.cs
+++ b/src/Umbraco.Web/Editors/MediaController.cs
@@ -6,39 +6,30 @@ using System.IO;
using System.Net;
using System.Net.Http;
using System.Net.Http.Formatting;
-using System.Security.AccessControl;
using System.Text;
using System.Threading.Tasks;
-using System.Web;
using System.Web.Http;
using System.Web.Http.ModelBinding;
using AutoMapper;
using Umbraco.Core;
-using Umbraco.Core.Dynamics;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
-using Umbraco.Core.Models.Editors;
using Umbraco.Core.Models.Membership;
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
using Umbraco.Core.Services;
-using Umbraco.Web.Models;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Models.Mapping;
using Umbraco.Web.Mvc;
using Umbraco.Web.WebApi;
using System.Linq;
-using System.Runtime.Serialization;
using System.Text.RegularExpressions;
using System.Web.Http.Controllers;
using Examine;
using Umbraco.Web.WebApi.Binders;
using Umbraco.Web.WebApi.Filters;
-using umbraco;
-using umbraco.BusinessLogic.Actions;
using Constants = Umbraco.Core.Constants;
using Umbraco.Core.Configuration;
-using Umbraco.Core.Persistence.FaultHandling;
using Umbraco.Web.UI;
using Notification = Umbraco.Web.Models.ContentEditing.Notification;
using Umbraco.Core.Persistence;
@@ -163,19 +154,48 @@ namespace Umbraco.Web.Editors
}
///
- /// Returns media items known to be a container of other media items
+ /// Returns media items known to be of a "Folder" type
///
///
///
+ [Obsolete("This is no longer used and shouldn't be because it performs poorly when there are a lot of media items")]
[FilterAllowedOutgoingMedia(typeof(IEnumerable>))]
public IEnumerable> GetChildFolders(int id = -1)
+ {
+ //we are only allowing a max of 500 to be returned here, if more is required it needs to be paged
+ var result = GetChildFolders(id, 1, 500);
+ return result.Items;
+ }
+
+ ///
+ /// Returns a paged result of media items known to be of a "Folder" type
+ ///
+ ///
+ ///
+ ///
+ ///
+ public PagedResult> GetChildFolders(int id, int pageNumber, int pageSize)
{
//Suggested convention for folder mediatypes - we can make this more or less complicated as long as we document it...
//if you create a media type, which has an alias that ends with ...Folder then its a folder: ex: "secureFolder", "bannerFolder", "Folder"
- var folderTypes = Services.ContentTypeService.GetAllMediaTypes().ToArray().Where(x => x.Alias.EndsWith("Folder")).Select(x => x.Id);
+ var folderTypes = Services.ContentTypeService
+ .GetAllMediaTypes()
+ .Where(x => x.Alias.EndsWith("Folder"))
+ .Select(x => x.Id)
+ .ToArray();
- var children = (id < 0) ? Services.MediaService.GetRootMedia() : Services.MediaService.GetById(id).Children();
- return children.Where(x => folderTypes.Contains(x.ContentTypeId)).Select(Mapper.Map>);
+ if (folderTypes.Length == 0)
+ {
+ return new PagedResult>(0, pageNumber, pageSize);
+ }
+
+ long total;
+ var children = Services.MediaService.GetPagedChildren(id, pageNumber - 1, pageSize, out total, "Name", Direction.Ascending, true, null, folderTypes.ToArray());
+
+ return new PagedResult>(total, pageNumber, pageSize)
+ {
+ Items = children.Select(Mapper.Map>)
+ };
}
///
diff --git a/src/Umbraco.Web/HealthCheck/Checks/DataIntegrity/XmlDataIntegrityHealthCheck.cs b/src/Umbraco.Web/HealthCheck/Checks/DataIntegrity/XmlDataIntegrityHealthCheck.cs
index 5d888ef117..8b94271e29 100644
--- a/src/Umbraco.Web/HealthCheck/Checks/DataIntegrity/XmlDataIntegrityHealthCheck.cs
+++ b/src/Umbraco.Web/HealthCheck/Checks/DataIntegrity/XmlDataIntegrityHealthCheck.cs
@@ -103,7 +103,7 @@ namespace Umbraco.Web.HealthCheck.Checks.DataIntegrity
///
private HealthCheckStatus CheckMedia()
{
- var total = _services.MediaService.Count();
+ var total = _services.MediaService.CountNotTrashed();
var mediaObjectType = Guid.Parse(Constants.ObjectTypes.Media);
//count entries
diff --git a/src/Umbraco.Web/WebServices/XmlDataIntegrityController.cs b/src/Umbraco.Web/WebServices/XmlDataIntegrityController.cs
index 66951d12f2..3d752a287b 100644
--- a/src/Umbraco.Web/WebServices/XmlDataIntegrityController.cs
+++ b/src/Umbraco.Web/WebServices/XmlDataIntegrityController.cs
@@ -51,7 +51,7 @@ namespace Umbraco.Web.WebServices
[HttpGet]
public bool CheckMediaXmlTable()
{
- var total = Services.MediaService.Count();
+ var total = Services.MediaService.CountNotTrashed();
var mediaObjectType = Guid.Parse(Constants.ObjectTypes.Media);
var subQuery = new Sql()
.Select("Count(*)")
diff --git a/src/Umbraco.Web/umbraco.presentation/content.cs b/src/Umbraco.Web/umbraco.presentation/content.cs
index edfffe03eb..c9d4308313 100644
--- a/src/Umbraco.Web/umbraco.presentation/content.cs
+++ b/src/Umbraco.Web/umbraco.presentation/content.cs
@@ -775,7 +775,6 @@ namespace umbraco
internal void SaveXmlToFile()
{
LogHelper.Info("Save Xml to file...");
-
try
{
// ok to access _xmlContent here - capture (atomic + volatile), immutable anyway
@@ -793,7 +792,7 @@ namespace umbraco
Directory.CreateDirectory(directoryName);
// save
- using (var fs = new FileStream(_xmlFileName, FileMode.Create, FileAccess.Write, FileShare.Read, bufferSize: 4096, useAsync: true))
+ using (var fs = new FileStream(_xmlFileName, FileMode.Create, FileAccess.Write, FileShare.Read))
{
SaveXmlToStream(xml, fs);
}
diff --git a/src/Umbraco.Web/umbraco.presentation/template.cs b/src/Umbraco.Web/umbraco.presentation/template.cs
index 4290ce2acf..50d3876f40 100644
--- a/src/Umbraco.Web/umbraco.presentation/template.cs
+++ b/src/Umbraco.Web/umbraco.presentation/template.cs
@@ -88,19 +88,20 @@ namespace umbraco
string originalPath = IOHelper.MapPath(VirtualPathUtility.ToAbsolute(MasterPageFile));
string copyPath = IOHelper.MapPath(VirtualPathUtility.ToAbsolute(path));
- FileStream fs = new FileStream(originalPath, FileMode.Open, FileAccess.ReadWrite);
- StreamReader f = new StreamReader(fs);
- String newfile = f.ReadToEnd();
- f.Close();
- fs.Close();
+ string newFile;
+ using (var fs = new FileStream(originalPath, FileMode.Open, FileAccess.ReadWrite))
+ using (var f = new StreamReader(fs))
+ {
+ newFile = f.ReadToEnd();
+ }
- newfile = newfile.Replace("MasterPageFile=\"~/masterpages/", "MasterPageFile=\"");
+ newFile = newFile.Replace("MasterPageFile=\"~/masterpages/", "MasterPageFile=\"");
- fs = new FileStream(copyPath, FileMode.Create, FileAccess.Write);
-
- StreamWriter replacement = new StreamWriter(fs);
- replacement.Write(newfile);
- replacement.Close();
+ using (var fs = new FileStream(copyPath, FileMode.Create, FileAccess.Write))
+ using (var replacement = new StreamWriter(fs))
+ {
+ replacement.Write(newFile);
+ }
}
return path;
diff --git a/src/umbraco.businesslogic/IO/SystemFiles.cs b/src/umbraco.businesslogic/IO/SystemFiles.cs
index 991ec0b29f..3c5841a31b 100644
--- a/src/umbraco.businesslogic/IO/SystemFiles.cs
+++ b/src/umbraco.businesslogic/IO/SystemFiles.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.ComponentModel;
using System.Configuration;
using System.IO;
using System.Linq;
@@ -54,7 +55,9 @@ namespace umbraco.IO
get { return Umbraco.Core.IO.SystemFiles.ContentCacheXml; }
}
- public static bool ContentCacheXmlIsEphemeral
+ [Obsolete("This is not used and will be removed in future versions")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static bool ContentCacheXmlIsEphemeral
{
get { return Umbraco.Core.IO.SystemFiles.ContentCacheXmlStoredInCodeGen; }
}
diff --git a/src/umbraco.cms/businesslogic/propertytype/propertytype.cs b/src/umbraco.cms/businesslogic/propertytype/propertytype.cs
index 8d5f538fd9..63a4d80e91 100644
--- a/src/umbraco.cms/businesslogic/propertytype/propertytype.cs
+++ b/src/umbraco.cms/businesslogic/propertytype/propertytype.cs
@@ -56,7 +56,7 @@ namespace umbraco.cms.businesslogic.propertytype
{
var found = ApplicationContext.Current.DatabaseContext.Database
.SingleOrDefault(
- "Select mandatory, DataTypeId, propertyTypeGroupId, contentTypeId, sortOrder, alias, name, validationRegExp, description from cmsPropertyType where id=@id",
+ "Select mandatory as mandatory, dataTypeId as dataTypeId, propertyTypeGroupId as propertyTypeGroupId, contentTypeId as contentTypeId, sortOrder as sortOrder, alias as alias, name as name, validationRegExp as validationRegExp, description as description from cmsPropertyType where id=@id",
new {id = id});
if (found == null)
@@ -72,14 +72,13 @@ namespace umbraco.cms.businesslogic.propertytype
_tabId = _propertyTypeGroup;
}
- //Fixed issue U4-9493 Case issues
_sortOrder = found.sortOrder;
- _alias = found.Alias;
- _name = found.Name;
+ _alias = found.alias;
+ _name = found.name;
_validationRegExp = found.validationRegExp;
_DataTypeId = found.dataTypeId;
_contenttypeid = found.contentTypeId;
- _description = found.Description;
+ _description = found.description;
}
#endregion