I keep getting the same error when updating published content or deleting content:
'concat' is not a recognized built-in function name. Incorrect syntax near 'umbracoNode'.
For example, a popup when trying to delete a node:
Any ideas?
The full stack trace from an another example from the log:
Exception
System.Data.SqlClient.SqlException (0x80131904): 'concat' is not a recognized built-in function name.
Incorrect syntax near 'umbracoNode'.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
at StackExchange.Profiling.Data.ProfiledDbCommand.ExecuteDbDataReader(CommandBehavior behavior) in C:\projects\dotnet\src\MiniProfiler.Shared\Data\ProfiledDbCommand.cs:line 208
at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
at Umbraco.Core.Persistence.FaultHandling.FaultHandlingDbCommand.<>c__DisplayClass30_0.<ExecuteDbDataReader>b__0()
at Umbraco.Core.Persistence.FaultHandling.FaultHandlingDbCommand.<>c__DisplayClass33_0`1.<Execute>b__0()
at Umbraco.Core.Persistence.FaultHandling.RetryPolicy.ExecuteAction[TResult](Func`1 func)
at Umbraco.Core.Persistence.FaultHandling.FaultHandlingDbCommand.Execute[T](Func`1 f)
at Umbraco.Core.Persistence.FaultHandling.FaultHandlingDbCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.ExecuteReader()
at NPoco.Database.ExecuteReaderHelper(DbCommand cmd)
at NPoco.Database.ExecuteDataReader(DbCommand cmd)
at NPoco.Database.<QueryImp>d__164`1.MoveNext()
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
at Umbraco.Web.PublishedCache.NuCache.ContentStore.SetBranch(Int32 rootContentId, IEnumerable`1 kits)
at Umbraco.Web.PublishedCache.NuCache.PublishedSnapshotService.NotifyLocked(IEnumerable`1 payloads, Boolean& draftChanged, Boolean& publishedChanged)
at Umbraco.Web.PublishedCache.NuCache.PublishedSnapshotService.Notify(JsonPayload[] payloads, Boolean& draftChanged, Boolean& publishedChanged)
at Umbraco.Web.Cache.ContentCacheRefresher.Refresh(JsonPayload[] payloads)
at Umbraco.Core.Sync.ServerMessengerBase.DeliverLocal[TPayload](ICacheRefresher refresher, TPayload[] payload)
at Umbraco.Core.Sync.ServerMessengerBase.Deliver[TPayload](ICacheRefresher refresher, TPayload[] payload)
at Umbraco.Core.Sync.ServerMessengerBase.PerformRefresh[TPayload](ICacheRefresher refresher, TPayload[] payload)
at Umbraco.Web.Cache.DistributedCache.RefreshByPayload[TPayload](Guid refresherGuid, IEnumerable`1 payloads)
at Umbraco.Web.Cache.DistributedCacheExtensions.RefreshContentCache(DistributedCache dc, TreeChange`1[] changes)
at Umbraco.Web.Cache.DistributedCacheBinder.ContentService_TreeChanged(IContentService sender, EventArgs args)
at Umbraco.Core.Events.EventDefinition`2.RaiseEvent()
at Umbraco.Core.Events.QueuingEventDispatcher.ScopeExitCompleted()
at Umbraco.Core.Events.QueuingEventDispatcherBase.ScopeExit(Boolean completed)
at Umbraco.Core.Scoping.Scope.<>c__DisplayClass72_0.<RobustExit>b__1()
at Umbraco.Core.Scoping.Scope.TryFinally(Int32 index, Action[] actions)
at Umbraco.Core.Scoping.Scope.TryFinally(Int32 index, Action[] actions)
at Umbraco.Core.Scoping.Scope.RobustExit(Boolean completed, Boolean onException)
at Umbraco.Core.Scoping.Scope.DisposeLastScope()
at Umbraco.Core.Scoping.Scope.Dispose()
at Umbraco.Core.Services.Implement.ContentService.SaveAndPublish(IContent content, String culture, Int32 userId, Boolean raiseEvents)
at Umbraco.Web.Editors.ContentController.PublishInternal(ContentItemSave contentItem, Boolean& wasCancelled, String[]& successfulCultures)
at Umbraco.Web.Editors.ContentController.PostSaveInternal(ContentItemSave contentItem, Func`2 saveMethod)
at Umbraco.Web.Editors.ContentController.PostSave(ContentItemSave contentItem)
at lambda_method(Closure , Object , Object[] )
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass6_2.<GetExecutor>b__2(Object instance, Object[] methodParameters)
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__6.MoveNext()
ClientConnectionId:f4d4a347-d33b-43a2-a8ee-dff6d2c13fb9
Error Number:195,State:10,Class:15
I've created a method that automatically creates a document type and a node, but now that I'm trying to implement multi languages, it errors out with (I'm using SQLCE by the way)
System.NotSupportedException: Umbraco.Core.Persistence.FaultHandling.FaultHandlingDbCommand
at Umbraco.Core.Persistence.NPocoDatabaseExtensions.GetTypedCommand[TCommand](IDbCommand command)
at Umbraco.Core.Persistence.NPocoDatabaseExtensions.BulkInsertRecordsSqlCe[T](IUmbracoDatabase database, PocoData pocoData, IEnumerable`1 records)
at Umbraco.Core.Persistence.NPocoDatabaseExtensions.BulkInsertRecords[T](IUmbracoDatabase database, IEnumerable`1 records, Boolean useNativeBulkInsert)
at Umbraco.Web.PublishedCache.NuCache.PublishedSnapshotService.RebuildContentDbCacheLocked(IScope scope, Int32 groupSize, IEnumerable`1 contentTypeIds)
at Umbraco.Web.PublishedCache.NuCache.PublishedSnapshotService.RebuildContentDbCache(Int32 groupSize, IEnumerable`1 contentTypeIds)
at Umbraco.Web.PublishedCache.NuCache.PublishedSnapshotService.OnContentTypeRefreshedEntity(IContentTypeService sender, EventArgs args)
at Umbraco.Core.Events.EventExtensions.RaiseEvent[TSender,TArgs](TypedEventHandler`2 eventHandler, TArgs args, TSender sender)
at Umbraco.Core.Services.Implement.ContentTypeServiceBase`2.OnUowRefreshedEntity(EventArgs args)
at Umbraco.Core.Services.Implement.ContentTypeServiceBase`3.Save(TItem item, Int32 userId)
at Umbraco.Plugins.Connector.Content.HomeDocumentType.SetContentVariations() in C:\Users\Carlos Casalicchio\source\repos\umbraco.packages.8\Umbraco.Plugins.Connector\Content\HomeDocumentType.cs:line 167
at Umbraco.Plugins.Connector.Controllers.ExternalApiConnectorController.CreateTenant(Tenant tenant) in C:\Users\Carlos Casalicchio\source\repos\umbraco.packages.8\Umbraco.Plugins.Connector\Controllers\ExternalApiConnectorController.cs:line 77
at lambda_method(Closure , Object , Object[] )
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass6_2.<GetExecutor>b__2(Object instance, Object[] methodParameters)
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)
My code is this (the ** is what is causing the issue). I have tried setting the language variations in the initial setup, but the error is the same.
Document Type -
namespace Umbraco.Plugins.Connector.Content
{
using System.Linq;
using Umbraco.Core;
using System.Reflection;
using Umbraco.Core.Models;
using Umbraco.Core.Services;
using Umbraco.Core.Composing;
using System.Collections.Generic;
using Umbraco.Plugins.Connector.Models;
using Umbraco.Plugins.Connector.Helpers;
public class HomeDocumentTypeComposer : ComponentComposer<HomeDocumentType>
{
public override void Compose(Composition composition)
{
composition.Components().Append<HomeDocumentType>();
base.Compose(composition);
}
}
public class HomeDocumentType : IComponent
{
public static string
CONTAINER = "Container",
DOCUMENT_TYPE_ALIAS = "tHome",
DOCUMENT_TYPE_NAME = "Home",
DOCUMENT_TYPE_DESCRIPTION = " Home Page (Simple Page)",
ICON = "icon-home color-blue",
TEMPLATE_ALIAS = "HomeTemplate",
TEMPLATE_NAME = "Home Template",
TENANT_TAB = "Info",
CONTENT_TAB = "Content";
private readonly IContentTypeService contentTypeService;
private readonly IDataTypeService dataTypeService;
private readonly IFileService fileService;
public HomeDocumentType(IContentTypeService contentTypeService, IDataTypeService dataTypeService, IFileService fileService)
{
this.contentTypeService = contentTypeService;
this.dataTypeService = dataTypeService;
this.fileService = fileService;
}
private void CreateHomeDocumentType()
{
var container = contentTypeService.GetContainers(CONTAINER, 1).FirstOrDefault();
int containerId = 0;
if (container == null)
{
var newcontainer = contentTypeService.CreateContainer(-1, CONTAINER);
if (newcontainer.Success)
containerId = newcontainer.Result.Entity.Id;
}
else
{
containerId = container.Id;
}
var contentType = contentTypeService.Get(DOCUMENT_TYPE_ALIAS);
if (contentType == null)
{
//http://refreshwebsites.co.uk/blog/umbraco-document-types-explained-in-60-seconds/
//https://our.umbraco.org/forum/developers/api-questions/43278-programmatically-creating-a-document-type
ContentType docType = (ContentType)contentType ?? new ContentType(containerId)
{
Name = DOCUMENT_TYPE_NAME,
Alias = DOCUMENT_TYPE_ALIAS,
AllowedAsRoot = true,
Description = DOCUMENT_TYPE_DESCRIPTION,
Icon = ICON,
SortOrder = 0,
//Variations = ContentVariation.Culture
};
// Create the Template if it doesn't exist
if (fileService.GetTemplate(TEMPLATE_ALIAS) == null)
{
//then create the template
Template newTemplate = new Template(TEMPLATE_NAME, TEMPLATE_ALIAS);
fileService.SaveTemplate(newTemplate);
}
// Set templates for document type
var template = fileService.GetTemplate(TEMPLATE_ALIAS);
docType.AllowedTemplates = new List<ITemplate> { template };
docType.SetDefaultTemplate(template);
docType.AddPropertyGroup(CONTENT_TAB);
docType.AddPropertyGroup(TENANT_TAB);
// Set Document Type Properties
#region Tenant Home Page Content
PropertyType brandLogoPropType = new PropertyType(dataTypeService.GetDataType(1043), "brandLogo")
{
Name = "Brand Logo",
Variations = ContentVariation.Culture
};
docType.AddPropertyType(brandLogoPropType, CONTENT_TAB);
PropertyType homeContentProType = new PropertyType(dataTypeService.GetDataType(-87), "homeContent")
{
Name = "Content",
Variations = ContentVariation.Culture
};
docType.AddPropertyType(homeContentProType, CONTENT_TAB);
#endregion
#region Tenant Info Tab
PropertyType brandNamePropType = new PropertyType(dataTypeService.GetDataType(-92), "brandName")
{
Name = "Brand Name",
Variations = ContentVariation.Culture
};
docType.AddPropertyType(brandNamePropType, TENANT_TAB);
PropertyType domainPropType = new PropertyType(dataTypeService.GetDataType(-92), "domain")
{
Name = "Domain",
Variations = ContentVariation.Nothing
};
docType.AddPropertyType(domainPropType, TENANT_TAB);
PropertyType subDomainPropType = new PropertyType(dataTypeService.GetDataType(-92), "subDomain")
{
Name = "Sub Domain",
Variations = ContentVariation.Nothing
};
docType.AddPropertyType(subDomainPropType, TENANT_TAB);
PropertyType appIdPropType = new PropertyType(dataTypeService.GetDataType(-92), "appId")
{
Name = "App Id",
Variations = ContentVariation.Nothing
};
docType.AddPropertyType(appIdPropType, TENANT_TAB);
PropertyType apiKeyPropType = new PropertyType(dataTypeService.GetDataType(-92), "apiKey")
{
Name = "Api Key",
Variations = ContentVariation.Nothing
};
docType.AddPropertyType(apiKeyPropType, TENANT_TAB);
PropertyType languagestPropType = new PropertyType(dataTypeService.GetDataType(-92), "languages")
{
Name = "Languages",
Variations = ContentVariation.Nothing
};
docType.AddPropertyType(languagestPropType, TENANT_TAB);
#endregion
contentTypeService.Save(docType);
CopyPhysicalTemplate();
}
}
public void SetContentVariations()
{
**var contentType = contentTypeService.Get(DOCUMENT_TYPE_ALIAS);
if (contentType != null)
{
ContentType docType = (ContentType)contentType;
docType.Variations = ContentVariation.Culture;
contentTypeService.Save(docType);
}**
}
private void CopyPhysicalTemplate()
{
var list = GetListOfEmbeddedResources(ResourceType.All);
var assembly = Assembly.GetExecutingAssembly();
if (list?.Count > 0)
{
//Copy physical files to destination
assembly.ExtractEmbeddedResource(list);
}
}
private List<EmbeddedResource> GetListOfEmbeddedResources(ResourceType resourceType)
{
List<EmbeddedResource> list = new List<EmbeddedResource>();
foreach (var resource in new EmbeddedResources().Resources)
{
if (resource.ResourceType == resourceType || resourceType == ResourceType.All)
list.Add(resource);
}
return list;
}
public void Initialize()
{
CreateHomeDocumentType();
}
public void Terminate() { }
}
}
The content Node -
namespace Umbraco.Plugins.Connector.Content
{
using System.Linq;
using Umbraco.Core.Models;
using Umbraco.Core.Services;
using Umbraco.Plugins.Connector.Models;
public class HomeContentNode
{
private readonly IContentService contentService;
private readonly IContentTypeService contentTypeService;
public HomeContentNode(IContentService contentService, IContentTypeService contentTypeService)
{
this.contentService = contentService;
this.contentTypeService = contentTypeService;
}
public int CreateHome(Tenant tenant)
{
var nodeName = tenant.BrandName;
var nodeAlias = tenant.BrandName.Trim(' ').ToLower();
var docType = contentTypeService.Get(HomeDocumentType.DOCUMENT_TYPE_ALIAS);
IContent thisNode = contentService.Create(nodeName, -1, HomeDocumentType.DOCUMENT_TYPE_ALIAS);
//thisNode.SetCultureName(nodeName, tenant.Languages.Default);
// Alternate Languages
foreach (var language in tenant.Languages.Alternate)
{
thisNode.SetValue("brandName", tenant.BrandName, language);
//thisNode.SetCultureName(nodeName, language);
}
// Set values for node
thisNode.SetValue("brandName", tenant.BrandName, tenant.Languages.Default);
thisNode.SetValue("domain", tenant.Domain);
thisNode.SetValue("subDomain", tenant.SubDomain);
thisNode.SetValue("apiKey", tenant.ApiKey);
thisNode.SetValue("appId", tenant.AppId);
thisNode.SetValue("languages", $"{tenant.Languages.Default}, {string.Join(", ", tenant.Languages.Alternate.ToList())}");
contentService.Save(thisNode);
return thisNode.Id;
}
}
}
and the language -
namespace Umbraco.Plugins.Connector.Content
{
using Umbraco.Core.Models;
using Umbraco.Core.Services;
using System.Collections.Generic;
using Umbraco.Plugins.Connector.Models;
public class LanguageDictionary
{
private readonly ILocalizationService localizationService;
private readonly IDomainService domainService;
public LanguageDictionary(ILocalizationService localizationService, IDomainService domainService)
{
this.localizationService = localizationService;
this.domainService = domainService;
}
public void CreateDictionary(Tenant tenant)
{
var lang = localizationService.GetLanguageByIsoCode(tenant.Languages.Default);
if (lang == null)
{
lang = new Language(tenant.Languages.Default)
{
IsDefault = true,
IsMandatory = true
};
localizationService.Save(lang);
}
foreach (var language in tenant.Languages.Alternate ?? new List<string>())
{
var translationLanguage = localizationService.GetLanguageByIsoCode(language);
if (translationLanguage == null)
{
translationLanguage = new Language(language)
{
FallbackLanguageId = lang.Id,
IsMandatory = false
};
localizationService.Save(translationLanguage);
}
}
}
public void SetCulturesAndHostnames(ExtendedTenant tenant)
{
// Create hostname and multi language
string domainName = $"{tenant.Tenant.SubDomain}/{tenant.Tenant.Languages.Default}/";
var domain = domainService.GetByName(domainName);
if (domain == null)
{
domain = new UmbracoDomain(domainName)
{
LanguageId = localizationService.GetLanguageIdByIsoCode(tenant.Tenant.Languages.Default),
RootContentId = tenant.StartContentId
};
domainService.Save(domain);
}
foreach (var language in tenant.Tenant.Languages.Alternate ?? new List<string>())
{
// Create hostname and multi language for secondary languages
var altDomainName = $"{tenant.Tenant.SubDomain}/{language}/";
var altDomain = domainService.GetByName(altDomainName);
if (altDomain == null)
{
altDomain = new UmbracoDomain(altDomainName)
{
LanguageId = localizationService.GetLanguageIdByIsoCode(language),
RootContentId = tenant.StartContentId
};
domainService.Save(altDomain);
}
}
}
}
}
Does anyone have any ideas as to what is wrong?
EDIT
Yes, it only occurs with SQLCE, when using MSSQL (2014) this issue does not happens at all.
Error updating or deleting content
I keep getting the same error when updating published content or deleting content:
For example, a popup when trying to delete a node:
Any ideas?
The full stack trace from an another example from the log:
I have same problem updating content. I just used 4.7.2 framework and default site. I have added some properties to "Home".
Did you use the NuGet package to install?
Yes. I used the nuget package manager to install package UmbracoCms -Version 8.0.0
Is there requirement for higher SQL server?
I use SQL Server 2008. I can see Umbraco requirements allow SQL Server 2008 https://our.umbraco.com/documentation/Getting-Started/Setup/Requirements/
It looks as though I am using SQL Server 2008 as well, although my hosting provider did state that they had tested Umbraco 8...
I believe that I have found the issue:
in the file
Umbraco-CMS\src\Umbraco.Core\Persistence\SqlSyntax\SqlSyntaxProviderBase.cs
On line 152:
return "concat(" + string.Join(",", args) + ")";
concat
is only available in SQL Server 2012+ (docs).I will raise this as an issue on the GitHub repository
Was this even fixed? I'm using Version 8.0.2 and still getting the exact same error...
I've created a method that automatically creates a document type and a node, but now that I'm trying to implement multi languages, it errors out with (I'm using SQLCE by the way)
My code is this (the ** is what is causing the issue). I have tried setting the language variations in the initial setup, but the error is the same.
Document Type -
The content Node -
and the language -
Does anyone have any ideas as to what is wrong?
EDIT
Yes, it only occurs with SQLCE, when using MSSQL (2014) this issue does not happens at all.
The problem is caused by the SQL version below 2012.
is working on a reply...