Quantcast
Channel: ActiveTopics
Viewing all 72689 articles
Browse latest View live

IContent property value

$
0
0

Is it possible to typecast a NestedContent property when getting the value through a IContent property

Example (that does not work) "items" is null

var service = ApplicationContext.Current.Services.ContentService;
var node =  service.GetById(nodeId);

var items = node.GetValue<IEnumerable<IPublishedContent>>("products");

If I try with node.GetValue("products") a fine JSON is returned.

I have tried using the UmbracoHelper and TypedContent to get a IPublishedContent. But at that moment in code there is no "UmbracoContext.Current".

-Mikkel


Invalid column name 'controlId' on upgrade

$
0
0

I'm trying to upgrade a project from v7.12.3 to v7.13.1, but I keep getting this error:

Invalid column name 'controlId'

The strange thing is, I upgraded successfully in my local environment, but on deployment to the live environment it caused this error, and I had to roll the code back.

Having followed the stack trace into the source code, it looks like what it's trying to do is a major version upgrade to v7, but clearly it shouldn't be, so it must be getting the wrong version number from somewhere. This site was built in Umbraco 7, and I've double checked the umbracoMigration table and the only upgrades are from older versions of 7.

I've had issues upgrading in the past, but they've generally been solved by some combination of clearing browser cookies/cache and clearing out temp folders on the Umbraco install.

I've also tried setting up a brand new site on the server with a copy of the live database and the upgraded code (with the old version number in web.config) and still get the same error.

I've scoured Stack Overflow and these forums, but haven't come across a solution that works for me. I'd really appreciate any assistance anyone can provide.

Adding a RTE to an umb-overlay

Fresh Install of Umbraco 8 in VS2017

$
0
0

Morning ,

Trying to have a play around with Ver8 today and I`m having great difficulty in getting installed . It installs fine via Nuget but when I go to run it for the first time I get :

Parser Error Message: Could not load type 'Umbraco.Web.UmbracoApplication'.

Source Error:

Line 1: <%@ Application Inherits="Umbraco.Web.UmbracoApplication" Language="C#" %> Source File: /global.asax Line: 1

I have done the trick of renaming the Namesapce and updated my Visual Studio to the latest version , Any ideas :(

Get Text value for DropDown field in custom ListView Layout

$
0
0

Hi,

I am using Umbraco 7 and following the tutorial at https://24days.in/umbraco-cms/2016/custom-list-view-layouts/ for creating a custom ListView Layout.

I have a custom DropDown field populated with prevalues and want to display it in the list view, however the listview shows the id stored, not the text prevalue:

enter image description here

How can I get the text prevalue in the angular controller. e.g. in Razor you could use something like @umbraco.library.GetPreValueAsString(Model.YourProperty)

Thanks,

Nick

I need help to choose the right hosting plan from Azure

$
0
0

Hi guys,

I need help to choose the right hosting plan from Azure.

I have considered Umbraco cloud but my client from Germany need hosting with datacenter in Germany so I am thinking about Azure because i think that CD/CI will be much easier on Azure.

I will build this application with Umbraco 8, application will have more than 1500 images, more than 500 members with a lot of data, also members will create some news, events etc...

What would you take from Azure for that kind of application?

App service instance A3 with Standard databse (how many DTUs) or something else?

Thanks

Josip

ContentService.Published - Can't get node from contentcache

SQL Error during installation

$
0
0

Hi,

I am trying a fresh install of Umbraco 8 using VS 2017 (4.7.2 .NET) and SQL Server Express 2014.

I am getting the following error after entering the connection details for the database:

This SqlTransaction has completed; it is no longer usable.

Could anyone suggest what might be going wrong please?


how to create custom tables, Migration, UmbracoDatabase, Npoco

$
0
0

Guys, I do not know if others have the same difficulty. Before asking a question here I always see the documentation and examples from the community and I did not find answers.

How do you use NPoco in Umbraco? I know how to use Npoco, mapping, columns, etc. But how to create a table in database? V7 I used migration and run with ApplicationEventHandler, https://gist.github.com/tcmorris/eae1fd6d5de0d600a3e3f7f74a05016f

but and now?

In this post: https://our.umbraco.com/forum/umbraco-8/95162-v8-create-table-based-on-poco-with-attributes

they talk to use new version of migration.

The only example I found was this: https://www.zpqrtbnk.net/posts/migrations-in-v8/

public class MyProjectUpgradeComponent : UmbracoUserComponent
{
    public override Initialize(IScopeProvider scopeProvider, IMigrationBuilder migrationBuilder, IKeyValueService keyValueService, ILogger logger)
    {
        var plan = new MigrationPlan("MyProject");
        plan.From(string.Empty)
            .To<Migration1>("state-1")
            .To<Migration2>("state-2")
            .To<Migration3>("state-3");

        var upgrader = new Upgrader(plan);
        upgrader.Execute(scopeProvider, migrationBuilder, keyValueService, logger);
    }
}

But this class UmbracoUserComponent does not exist in Umbraco.Core. In the IComponent implementation I do not have the MigrationBuilder parameter to pass the Upgrader method execute.

https://our.umbraco.com/documentation/Tutorials/Porting-Packages-V8/#new-composer--component-way

the Initialize method does not have these parameters IScopeProvider, IMigrationBuilder

how to run the migration in new way?

The ApplicationContext no longer exists. Now we have "Current", which seems to be much better. But I did not find anything about UmbracoDatabase. Previously we had ApplicationContext.Current.DatabaseContext.Database. I found only SqlContext but without the UmbracoDatabase object. How do I query in the database? insert? update? delete?

I found this example: https://our.umbraco.com/forum/umbraco-8/95162-v8-create-table-based-on-poco-with-attributes#comment-300870

using (var scope = Current.ScopeProvider.CreateScope())
{
    var sql = scope.SqlContext.Sql()
        .Select<Record>(x=>x.Form)
        .From<Record>()
        .Where<Record>(x => x.UniqueId == recordId);

    var formId = scope.Database.ExecuteScalar<Guid>(sql);

    scope.Complete();

    return GetForm(formId);
}

is that so? Is this practice?

I think there was a little more documentation for the basic things we always do in the umbraco.

I know it's early, I even apologize for being rushed. But I wanted to start a project already with umbraco 8 and having a table in the custom database is something we always do. And the documentation does not address this. purpose of this post is to elucidate these my doubts to contribute with the documentation

Macro not rendering

$
0
0

I made a clean install of Umbraco 8. Then I inserted a macro in the richtext editor. The macro renders correct in the backend, but in the frontend the output is "Umbraco.Web.Macros.MacroContent". Plain text renders correct in both backend and frontend. The template code for rendering the richtext editor looks like this:

        @Model.Value("leftBodyText")

Any ideas of what I'm doing wrong?

Umbraco 7.13.2 to 8.0

$
0
0

I've tried just using NuGet update to the latest Umbraco but just causes an headache of issues with references.

So, I've created an new project and downloaded Umbraco 8 and I've updated the Web.config application setting of "umbracoConfigurationStatus" to "7.13.2" and "umbracoDbDSN" to my local database. So, there no custom views or anything which I'll manually copy across when I've upgraded the database.

However, I'm getting the following errors: Upgrade DB #1 Upgrade DB #2

There is no table named "umbracoKeyValue" or anything in the project.

The log doesn't say much more than:

The full log is here:

{"@t":"2019-02-27T14:21:07.4693346Z","@mt":"{StartMessage} [Timing {TimingId}]","StartMessage":"Executing installation step: 'DatabaseUpgrade'.","TimingId":"c7f58c2","SourceContext":"Umbraco.Web.Install.Controllers.InstallApiController","ProcessId":6816,"ProcessName":"iisexpress","ThreadId":26,"AppDomainId":2,"AppDomainAppId":"LMW3SVC2ROOT","MachineName":"MAIN-PC","Log4NetLevel":"INFO ","HttpRequestNumber":10,"HttpRequestId":"5d04229d-d880-4262-b3cd-730231870af7"}
{"@t":"2019-02-27T14:21:07.4693346Z","@mt":"Running 'Upgrade' service","SourceContext":"Umbraco.Web.Install.InstallSteps.DatabaseUpgradeStep","ProcessId":6816,"ProcessName":"iisexpress","ThreadId":26,"AppDomainId":2,"AppDomainAppId":"LMW3SVC2ROOT","MachineName":"MAIN-PC","Log4NetLevel":"INFO ","HttpRequestNumber":10,"HttpRequestId":"5d04229d-d880-4262-b3cd-730231870af7"}
{"@t":"2019-02-27T14:21:07.4693346Z","@mt":"Database upgrade started","SourceContext":"Umbraco.Core.Migrations.Install.DatabaseBuilder","ProcessId":6816,"ProcessName":"iisexpress","ThreadId":26,"AppDomainId":2,"AppDomainAppId":"LMW3SVC2ROOT","MachineName":"MAIN-PC","Log4NetLevel":"INFO ","HttpRequestNumber":10,"HttpRequestId":"5d04229d-d880-4262-b3cd-730231870af7"}
{"@t":"2019-02-27T14:21:07.4803260Z","@mt":"Exception ({InstanceId}).","@l":"Error","@x":"System.Data.SqlClient.SqlException (0x80131904): Invalid object name 'umbracoKeyValue'.\r\n   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)\r\n   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)\r\n   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)\r\n   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)\r\n   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()\r\n   at System.Data.SqlClient.SqlDataReader.get_MetaData()\r\n   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)\r\n   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)\r\n   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)\r\n   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)\r\n   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)\r\n   at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)\r\n   at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)\r\n   at StackExchange.Profiling.Data.ProfiledDbCommand.ExecuteDbDataReader(CommandBehavior behavior) in C:\\projects\\dotnet\\src\\MiniProfiler.Shared\\Data\\ProfiledDbCommand.cs:line 208\r\n   at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)\r\n   at Umbraco.Core.Persistence.FaultHandling.FaultHandlingDbCommand.<>c__DisplayClass30_0.<ExecuteDbDataReader>b__0()\r\n   at Umbraco.Core.Persistence.FaultHandling.FaultHandlingDbCommand.<>c__DisplayClass33_0`1.<Execute>b__0()\r\n   at Umbraco.Core.Persistence.FaultHandling.RetryPolicy.ExecuteAction[TResult](Func`1 func)\r\n   at Umbraco.Core.Persistence.FaultHandling.FaultHandlingDbCommand.Execute[T](Func`1 f)\r\n   at Umbraco.Core.Persistence.FaultHandling.FaultHandlingDbCommand.ExecuteDbDataReader(CommandBehavior behavior)\r\n   at System.Data.Common.DbCommand.ExecuteReader()\r\n   at NPoco.Database.ExecuteReaderHelper(DbCommand cmd)\r\n   at NPoco.Database.ExecuteDataReader(DbCommand cmd)\r\nClientConnectionId:d6fa6613-2ada-4729-80f4-edc866f433fb\r\nError Number:208,State:1,Class:16","InstanceId":"65e24bb4","SourceContext":"Umbraco.Core.Persistence.UmbracoDatabase","ProcessId":6816,"ProcessName":"iisexpress","ThreadId":26,"AppDomainId":2,"AppDomainAppId":"LMW3SVC2ROOT","MachineName":"MAIN-PC","Log4NetLevel":"ERROR","HttpRequestNumber":10,"HttpRequestId":"5d04229d-d880-4262-b3cd-730231870af7"}
{"@t":"2019-02-27T14:21:07.4813373Z","@mt":"Database configuration failed","@l":"Error","@x":"System.Data.SqlClient.SqlException (0x80131904): Invalid object name 'umbracoKeyValue'.\r\n   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)\r\n   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)\r\n   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)\r\n   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)\r\n   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()\r\n   at System.Data.SqlClient.SqlDataReader.get_MetaData()\r\n   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)\r\n   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)\r\n   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)\r\n   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)\r\n   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)\r\n   at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)\r\n   at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)\r\n   at StackExchange.Profiling.Data.ProfiledDbCommand.ExecuteDbDataReader(CommandBehavior behavior) in C:\\projects\\dotnet\\src\\MiniProfiler.Shared\\Data\\ProfiledDbCommand.cs:line 208\r\n   at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)\r\n   at Umbraco.Core.Persistence.FaultHandling.FaultHandlingDbCommand.<>c__DisplayClass30_0.<ExecuteDbDataReader>b__0()\r\n   at Umbraco.Core.Persistence.FaultHandling.FaultHandlingDbCommand.<>c__DisplayClass33_0`1.<Execute>b__0()\r\n   at Umbraco.Core.Persistence.FaultHandling.RetryPolicy.ExecuteAction[TResult](Func`1 func)\r\n   at Umbraco.Core.Persistence.FaultHandling.FaultHandlingDbCommand.Execute[T](Func`1 f)\r\n   at Umbraco.Core.Persistence.FaultHandling.FaultHandlingDbCommand.ExecuteDbDataReader(CommandBehavior behavior)\r\n   at System.Data.Common.DbCommand.ExecuteReader()\r\n   at NPoco.Database.ExecuteReaderHelper(DbCommand cmd)\r\n   at NPoco.Database.ExecuteDataReader(DbCommand cmd)\r\n   at NPoco.Database.<QueryImp>d__164`1.MoveNext()\r\n   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)\r\n   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)\r\n   at NPoco.Database.Fetch[T](Sql sql)\r\n   at Umbraco.Core.Services.Implement.KeyValueService.GetValue(String key)\r\n   at Umbraco.Core.Migrations.Upgrade.Upgrader.Execute(IScopeProvider scopeProvider, IMigrationBuilder migrationBuilder, IKeyValueService keyValueService, ILogger logger)\r\n   at Umbraco.Core.Migrations.Install.DatabaseBuilder.UpgradeSchemaAndData(MigrationPlan plan)\r\nClientConnectionId:d6fa6613-2ada-4729-80f4-edc866f433fb\r\nError Number:208,State:1,Class:16","SourceContext":"Umbraco.Core.Migrations.Install.DatabaseBuilder","ProcessId":6816,"ProcessName":"iisexpress","ThreadId":26,"AppDomainId":2,"AppDomainAppId":"LMW3SVC2ROOT","MachineName":"MAIN-PC","Log4NetLevel":"ERROR","HttpRequestNumber":10,"HttpRequestId":"5d04229d-d880-4262-b3cd-730231870af7"}
{"@t":"2019-02-27T14:21:07.4823345Z","@mt":"The database schema validation produced the following summary: {DbSchemaSummary}","DbSchemaSummary":"The following tables were found in the database, but are not in the current schema:\r\nUFUserFormSecurity,UFUserSecurity,umbracoDomains,umbracoMigration,cmsContent,cmsContentVersion,cmsContentXml,cmsDataType,cmsDataTypePreValues,cmsDocument,cmsMedia,cmsPreviewXml,cmsPropertyData,cmsTask,cmsTaskType,UFRecordDataBit,UFRecordDataDateTime,UFRecordDataInteger,UFRecordDataLongString,UFRecordDataString,UFRecordFields,UFRecords,umbracoContent,umbracoContentVersion,umbracoMediaVersion,umbracoDocument,umbracoDataType,umbracoDomain,umbracoPropertyData,cmsContentNu,umbracoDocumentVersion,umbracoKeyValue,umbracoContentVersionCultureVariation,umbracoDocumentCultureVariation,umbracoContentSchedule\r\n \r\nThe following columns were found in the database, but are not in the current schema:\r\nUFUserFormSecurity,Id,UFUserFormSecurity,User,UFUserFormSecurity,Form,UFUserFormSecurity,HasAccess,UFUserFormSecurity,AllowInEditor,UFUserFormSecurity,SecurityType,UFUserSecurity,User,UFUserSecurity,ManageDataSources,UFUserSecurity,ManagePreValueSources,UFUserSecurity,ManageWorkflows,UFUserSecurity,ManageForms,umbracoDomains,id,umbracoDomains,domainDefaultLanguage,umbracoDomains,domainRootStructureID,umbracoDomains,domainName,umbracoMigration,id,umbracoMigration,name,umbracoMigration,createDate,umbracoMigration,version,cmsContent,pk,cmsContent,nodeId,cmsContent,contentType,cmsContentVersion,id,cmsContentVersion,ContentId,cmsContentVersion,VersionId,cmsContentVersion,VersionDate,cmsContentXml,nodeId,cmsContentXml,xml,cmsDataType,pk,cmsDataType,nodeId,cmsDataType,propertyEditorAlias,cmsDataType,dbType,cmsDataTypePreValues,id,cmsDataTypePreValues,datatypeNodeId,cmsDataTypePreValues,value,cmsDataTypePreValues,sortorder,cmsDataTypePreValues,alias,cmsDocument,nodeId,cmsDocument,published,cmsDocument,documentUser,cmsDocument,versionId,cmsDocument,text,cmsDocument,releaseDate,cmsDocument,expireDate,cmsDocument,updateDate,cmsDocument,templateId,cmsDocument,newest,cmsMacro,macroScriptType,cmsMacro,macroScriptAssembly,cmsMacro,macroXSLT,cmsMacro,macroPython,cmsMedia,nodeId,cmsMedia,versionId,cmsMedia,mediaPath,cmsPreviewXml,nodeId,cmsPreviewXml,versionId,cmsPreviewXml,timestamp,cmsPreviewXml,xml,cmsPropertyData,id,cmsPropertyData,contentNodeId,cmsPropertyData,versionId,cmsPropertyData,propertytypeid,cmsPropertyData,dataInt,cmsPropertyData,dataDecimal,cmsPropertyData,dataDate,cmsPropertyData,dataNvarchar,cmsPropertyData,dataNtext,cmsTags,ParentId,cmsTask,closed,cmsTask,id,cmsTask,taskTypeId,cmsTask,nodeId,cmsTask,parentUserId,cmsTask,userId,cmsTask,DateTime,cmsTask,Comment,cmsTaskType,id,cmsTaskType,alias,cmsTemplate,design,UFRecordDataBit,Id,UFRecordDataBit,Key,UFRecordDataBit,Value,UFRecordDataDateTime,Id,UFRecordDataDateTime,Key,UFRecordDataDateTime,Value,UFRecordDataInteger,Id,UFRecordDataInteger,Key,UFRecordDataInteger,Value,UFRecordDataLongString,Id,UFRecordDataLongString,Key,UFRecordDataLongString,Value,UFRecordDataString,Id,UFRecordDataString,Key,UFRecordDataString,Value,UFRecordFields,Key,UFRecordFields,FieldId,UFRecordFields,Record,UFRecordFields,Alias,UFRecordFields,DataType,UFRecords,Id,UFRecords,Form,UFRecords,Created,UFRecords,Updated,UFRecords,CurrentPage,UFRecords,UmbracoPageId,UFRecords,IP,UFRecords,MemberKey,UFRecords,UniqueId,UFRecords,State,UFRecords,RecordData,cmsContentType,isElement,cmsContentType,variations,umbracoContent,nodeId,umbracoContent,contentTypeId,umbracoContentVersion,id,umbracoContentVersion,nodeId,umbracoContentVersion,versionDate,umbracoContentVersion,userId,umbracoContentVersion,current,umbracoContentVersion,text,umbracoMediaVersion,id,umbracoMediaVersion,path,umbracoDocument,nodeId,umbracoDocument,published,umbracoDocument,edited,umbracoDataType,nodeId,umbracoDataType,propertyEditorAlias,umbracoDataType,dbType,umbracoDataType,config,umbracoLanguage,isDefaultVariantLang,umbracoLanguage,mandatory,umbracoLanguage,fallbackLanguageId,umbracoDomain,id,umbracoDomain,domainDefaultLanguage,umbracoDomain,domainRootStructureID,umbracoDomain,domainName,umbracoLog,entityType,umbracoLog,parameters,cmsMacro,macroSource,cmsMacro,macroType,cmsPropertyType,variations,umbracoPropertyData,id,umbracoPropertyData,versionId,umbracoPropertyData,propertyTypeId,umbracoPropertyData,languageId,umbracoPropertyData,segment,umbracoPropertyData,intValue,umbracoPropertyData,decimalValue,umbracoPropertyData,dateValue,umbracoPropertyData,varcharValue,umbracoPropertyData,textValue,cmsTags,languageId,umbracoRedirectUrl,culture,cmsContentNu,nodeId,cmsContentNu,published,cmsContentNu,data,cmsContentNu,rv,umbracoDocumentVersion,id,umbracoDocumentVersion,templateId,umbracoDocumentVersion,published,umbracoKeyValue,key,umbracoKeyValue,value,umbracoKeyValue,updated,umbracoContentVersionCultureVariation,id,umbracoContentVersionCultureVariation,versionId,umbracoContentVersionCultureVariation,languageId,umbracoContentVersionCultureVariation,name,umbracoContentVersionCultureVariation,date,umbracoContentVersionCultureVariation,availableUserId,umbracoDocumentCultureVariation,id,umbracoDocumentCultureVariation,nodeId,umbracoDocumentCultureVariation,languageId,umbracoDocumentCultureVariation,edited,umbracoDocumentCultureVariation,available,umbracoDocumentCultureVariation,published,umbracoDocumentCultureVariation,name,umbracoContentSchedule,id,umbracoContentSchedule,nodeId,umbracoContentSchedule,languageId,umbracoContentSchedule,date,umbracoContentSchedule,action\r\n \r\nThe following constraints (Primary Keys, Foreign Keys and Indexes) were found in the database, but are not in the current schema:\r\nFK_cmsContent_cmsContentType_nodeId,FK_cmsContent_umbracoNode_id,FK_cmsContentVersion_cmsContent_nodeId,FK_cmsContentXml_cmsContent_nodeId,FK_cmsDataType_umbracoNode_id,FK_cmsDataTypePreValues_cmsDataType_nodeId,FK_cmsDocument_cmsContent_nodeId,FK_cmsDocument_cmsTemplate_nodeId,FK_cmsDocument_umbracoNode_id,FK_cmsMedia_cmsContent_nodeId,FK_cmsMedia_umbracoNode_id,FK_cmsMember_cmsContent_nodeId,FK_cmsMember_umbracoNode_id,FK_cmsPreviewXml_cmsContent_nodeId,FK_cmsPreviewXml_cmsContentVersion_VersionId,FK_cmsPropertyData_cmsPropertyType_id,FK_cmsPropertyData_umbracoNode_id,FK_cmsPropertyType_cmsDataType_nodeId,FK_cmsTags_cmsTags,FK_cmsTask_cmsTaskType_id,FK_cmsTask_umbracoNode_id,FK_cmsTask_umbracoUser,FK_cmsTask_umbracoUser1,FK_UFRecordDataBit_UFRecordFields_Key,FK_UFRecordDataDateTime_UFRecordFields_Key,FK_UFRecordDataInteger_UFRecordFields_Key,FK_UFRecordDataLongString_UFRecordFields_Key,FK_UFRecordDataString_UFRecordFields_Key,FK_umbracoDomains_umbracoNode_id,FK_umbracoNode_umbracoUser_id,FK_umbracoContent_umbracoNode_id,FK_umbracoContent_cmsContentType_NodeId,FK_umbracoContentVersion_umbracoContent_nodeId,FK_umbracoContentVersion_umbracoUser_id,FK_umbracoMediaVersion_umbracoContentVersion_id,FK_umbracoDocument_umbracoContent_nodeId,FK_umbracoDataType_umbracoNode_id,FK_umbracoLanguage_umbracoLanguage_id,FK_umbracoDomain_umbracoNode_id,FK_umbracoLog_umbracoUser_id,FK_cmsMember_umbracoContent_nodeId,FK_cmsPropertyType_umbracoDataType_nodeId,FK_umbracoPropertyData_umbracoContentVersion_id,FK_umbracoPropertyData_cmsPropertyType_id,FK_umbracoPropertyData_umbracoLanguage_id,FK_cmsTags_umbracoLanguage_id,FK_cmsContentNu_umbracoContent_nodeId,FK_umbracoDocumentVersion_umbracoContentVersion_id,FK_umbracoDocumentVersion_cmsTemplate_nodeId,FK_umbracoContentVersionCultureVariation_umbracoContentVersion_id,FK_umbracoContentVersionCultureVariation_umbracoLanguage_id,FK_umbracoContentVersionCultureVariation_umbracoUser_id,FK_umbracoDocumentCultureVariation_umbracoNode_id,FK_umbracoDocumentCultureVariation_umbracoLanguage_id,FK_umbracoContentSchedule_umbracoContent_nodeId,FK_umbracoContentSchedule_umbracoLanguage_id,PK_cmsContent,PK_cmsContentPreviewXml,PK_cmsContentVersion,PK_cmsContentXml,PK_cmsDataType,PK_cmsDataTypePreValues,PK_cmsDocument,PK_cmsMedia,PK_cmsPropertyData,PK_cmsTask,PK_cmsTaskType,PK_structure,PK_UFRecordDataBit,PK_UFRecordDataDateTime,PK_UFRecordDataInteger,PK_UFRecordDataLongString,PK_UFRecordDataString,PK_UFRecordFields,PK_UFRecords,PK_umbracoDomains,PK_umbracoMigration,PK_umbracoNode,PK_umbracoContent,PK_umbracoContentVersion,PK_umbracoMediaVersion,PK_umbracoDocument,PK_umbracoDataType,PK_umbracoDomain,PK_umbracoPropertyData,PK_cmsContentNu,PK_umbracoDocumentVersion,PK_umbracoKeyValue,PK_umbracoContentVersionCultureVariation,PK_umbracoDocumentCultureVariation,PK_umbracoContentSchedule\r\n \r\nThe following indexes were found in the database, but are not in the current schema:\r\nIX_cmsContent,IX_cmsContentVersion_ContentId,IX_cmsContentVersion_VersionId,IX_cmsDataType_nodeId,IX_cmsDocument,IX_cmsDocument_newest,IX_cmsDocument_published,IX_cmsMedia,IX_cmsPropertyData_1,IX_cmsPropertyData_2,IX_cmsPropertyData_3,IX_cmsTaskType_alias,IX_databit_recordfield,IX_datadatetime_recordfield,IX_datainteger_recordfield,IX_datalongstring_recordfield,IX_datastring_recordfield,IX_umbracoMigration,IX_umbracoNodeObjectType,IX_umbracoNodeParentId,IX_umbracoNodePath,IX_umbracoNodeTrashed,IX_umbracoNodeUniqueID,IX_umbracoNode_UniqueId,IX_umbracoNode_ParentId,IX_umbracoNode_Path,IX_umbracoNode_Trashed,IX_umbracoNode_ObjectType,IX_umbracoMediaVersion,IX_umbracoDocument_Published,IX_umbracoLanguage_fallbackLanguageId,IX_umbracoPropertyData_VersionId,IX_umbracoPropertyData_PropertyTypeId,IX_umbracoPropertyData_LanguageId,IX_umbracoPropertyData_Segment,IX_cmsTags_LanguageId,IX_userLoginDto_lastValidatedUtc,IX_umbracoContentVersionCultureVariation_VersionId,IX_umbracoContentVersionCultureVariation_LanguageId,IX_umbracoDocumentCultureVariation_NodeId,IX_umbracoDocumentCultureVariation_LanguageId\r\n \r\nThe following unknown constraints (Primary Keys, Foreign Keys and Indexes) were found in the database, but are not in the current schema:\r\nId\r\n \r\n","SourceContext":"Umbraco.Core.Migrations.Install.DatabaseBuilder","ProcessId":6816,"ProcessName":"iisexpress","ThreadId":26,"AppDomainId":2,"AppDomainAppId":"LMW3SVC2ROOT","MachineName":"MAIN-PC","Log4NetLevel":"INFO ","HttpRequestNumber":10,"HttpRequestId":"5d04229d-d880-4262-b3cd-730231870af7"}
{"@t":"2019-02-27T14:21:07.4893195Z","@mt":"Installation step {Step} failed.","@l":"Error","@x":"System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Umbraco.Web.Install.InstallException: The database failed to upgrade. ERROR: The database configuration failed with the following message: Invalid object name 'umbracoKeyValue'.\n Please check log file for additional information (can be found in '/App_Data/Logs/UmbracoTraceLog.txt')\r\n   at Umbraco.Web.Install.InstallSteps.DatabaseUpgradeStep.ExecuteAsync(Object model)\r\n   --- End of inner exception stack trace ---\r\n   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)\r\n   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)\r\n   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)\r\n   at Umbraco.Web.Install.Controllers.InstallApiController.<ExecuteStepAsync>d__14.MoveNext()","Step":"DatabaseUpgrade","SourceContext":"Umbraco.Web.Install.Controllers.InstallApiController","ProcessId":6816,"ProcessName":"iisexpress","ThreadId":26,"AppDomainId":2,"AppDomainAppId":"LMW3SVC2ROOT","MachineName":"MAIN-PC","Log4NetLevel":"ERROR","HttpRequestNumber":10,"HttpRequestId":"5d04229d-d880-4262-b3cd-730231870af7"}
{"@t":"2019-02-27T14:21:07.4903177Z","@mt":"{EndMessage} ({Duration}ms) [Timing {TimingId}]","EndMessage":"Step completed","Duration":21,"TimingId":"c7f58c2","SourceContext":"Umbraco.Web.Install.Controllers.InstallApiController","ProcessId":6816,"ProcessName":"iisexpress","ThreadId":26,"AppDomainId":2,"AppDomainAppId":"LMW3SVC2ROOT","MachineName":"MAIN-PC","Log4NetLevel":"INFO ","HttpRequestNumber":10,"HttpRequestId":"5d04229d-d880-4262-b3cd-730231870af7"}
{"@t":"2019-02-27T14:21:07.4903177Z","@mt":"An error occurred during installation step {Step}","@l":"Error","@x":"System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Umbraco.Web.Install.InstallException: The database failed to upgrade. ERROR: The database configuration failed with the following message: Invalid object name 'umbracoKeyValue'.\n Please check log file for additional information (can be found in '/App_Data/Logs/UmbracoTraceLog.txt')\r\n   at Umbraco.Web.Install.InstallSteps.DatabaseUpgradeStep.ExecuteAsync(Object model)\r\n   --- End of inner exception stack trace ---\r\n   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)\r\n   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)\r\n   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)\r\n   at Umbraco.Web.Install.Controllers.InstallApiController.<ExecuteStepAsync>d__14.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)\r\n   at Umbraco.Web.Install.Controllers.InstallApiController.<PostPerformInstall>d__11.MoveNext()","Step":"DatabaseUpgrade","SourceContext":"Umbraco.Web.Install.Controllers.InstallApiController","ProcessId":6816,"ProcessName":"iisexpress","ThreadId":26,"AppDomainId":2,"AppDomainAppId":"LMW3SVC2ROOT","MachineName":"MAIN-PC","Log4NetLevel":"ERROR","HttpRequestNumber":10,"HttpRequestId":"5d04229d-d880-4262-b3cd-730231870af7"}

Any tips or help migrating or upgrading the project would be much appreciated. Thanks.

Create Media on Azure Blob Storage Using C#

$
0
0

Hi Guys,

I am using UmbracoFileSystemProviders.Azure to setup Umbraco media files to use an Azure storage account.

I have requirement to create media(Image) in azure blob storage using c# code. Here is the code I used before with local file system.

public int SaveImage(string url, int mediaNodeId)
    {
        try
        {
            var mediaService = Services.MediaService;
            string originalFileName = Path.GetFileName(url);
            string filenameToSave = Path.GetFileNameWithoutExtension(originalFileName) + Guid.NewGuid() + Path.GetExtension(originalFileName);

            string imageUrl = url;
            string saveLocation = Server.MapPath("~/Imports/" + filenameToSave);

            byte[] imageBytes;
            HttpWebRequest imageRequest = (HttpWebRequest)WebRequest.Create(imageUrl);
            WebResponse imageResponse = imageRequest.GetResponse();

            Stream responseStream = imageResponse.GetResponseStream();

            using (BinaryReader br = new BinaryReader(responseStream))
            {
                imageBytes = br.ReadBytes(500000000);
                br.Close();
            }
            responseStream.Close();
            imageResponse.Close();

            FileStream fs = new FileStream(saveLocation, FileMode.Create);
            BinaryWriter bw = new BinaryWriter(fs);

            bw.Write(imageBytes);

            var mediaImage = mediaService.CreateMedia(originalFileName, mediaNodeId, "Image");
            mediaImage.SetValue("umbracoFile", originalFileName, fs);
            mediaService.Save(mediaImage);
            fs.Close();
            bw.Close();
            return mediaImage.Id;

        }
        catch (Exception ex)
        {

        }
        return 0;
    }

The above code is not working when I am trying to create image to Azure blob storage. Please help!

Multiple DocTypes in Nested Content

$
0
0

Hey there,

I'm working with Nested Content inside LeBlender grid editors. It's been working fine so far. Except now I'm trying to use multiple Doc Types in the same Nested Content Data Type. The issue I'm having is only rendering the code for the Doc Type they are using. Here's the razor I have now:

@inherits UmbracoViewPage<Lecoati.LeBlender.Extension.Models.LeBlenderModel>
@foreach (var item in Model.Items) {
@* START VARIABLES *@
var getContent = item.GetValue<IEnumerable<IPublishedContent>>("cgeContent");
@* END VARIABLES *@
@* START CONTENT *@
<div class="fancy-text">
    @foreach (IPublishedContent content in getContent) {
        var getText1 = Html.Raw(content.GetPropertyValue("cgeText"));
        var getText2 = Html.Raw(content.GetPropertyValue("leftContent"));
        var getText3 = Html.Raw(content.GetPropertyValue("rightContent"));
        if (getText1 != null) {
            <div class="ft-content">@getText1</div>
        }
        if (getText2 != null) {
            <div class="ft-content flex">
                <div class="col txt1">@getText2</div>
                <div class="col txt2">@getText3</div>
            </div>
        }
    }
</div>

@* END CONTENT *@ }

So one Doc Type has the getText1, and the other has the other two. Checking to see if the content is null seems like a bad way of doing it, but it was all I could think of at the time. But it's not even working. Each item in the Nested Content renders both pieces regardless of which Doc Type was selected.

Is there a way to just say "if using the Doc Type with this alias"?

Thanks!

Empty fields in nested content - Translation manager v2.2.3

$
0
0

Is there a setting to avoid sending empty fields for translation in the Translation settings or Set? Fields within nested content are being sent for translation even though they are empty.

Also, is there a way to exclude specific Leblender grid content properties from being sent for translation?

Using Translation Manager 2.2.3

Thanks!

Umbraco 8 - Render Model Equivelant

$
0
0

What is the RenderModel equivelant class in v8?

for creating a custom View Model


Automatically create rel=canonical for each page when it is published

$
0
0

Hi

I'm trying to find out if there's a way to automatically publish a rel=canonical tag for each page in our web sites? Currently we're asking clients to do this manually, but they are busy and forget - it's understandable.

Feels like it's such an obvious requirement for SEO that there must be a straightforward way to do it without the web editor needing to do anything except publish their page?

Thanks, John

Getting the Database in v8

$
0
0

How can I get the database in v8?

In v7 I can find it in ApplicationContext.Current.DatabaseContext.Database

Umbraco v8 and .NET

$
0
0

Just wondering, I see the upgrade to .NET 4.6.1, what is the reasoning for not upgrading to 4.7.1? There were known issues relating to the facades and assembly versioning in the 4.6 versions... just thinking that it might be worth making that change as well?

Umbraco 8 - Courier

$
0
0

Hi,

can you let me know if Courier will be available for Umbraco 8?

Thanks

Jon

New to Umbraco - following documentation - preview shows nothing on screen?

$
0
0

I've literally just started out with Umbraco, and have had a couple of issues I'd like to clarify.

1) The documentation suggests setting up 2 empty ASP.NET projects attached to a solution. One called xxx.UI and the other xxxx.Core. The documentation then suggests to use Nuget to add the Umbraco.UI package to the UI project and the Umbraco.Core package to the Core project. However, when I add Umbraco.UI to the solution (with the UI project selected)) the package appears to already install the Core package as well. When I try to install the Core package to the Core project, I get the error:

The solution already contains Umbraco.Core in the project xxxx.UI.

Is this expected? How can I resolve this?

2) I am following the documentation to create a simple Home root node, and an About Us document type / content. I have completed this, but when I select Save/Publish, then Preview, the resulting preview screen is blank. Is this expected?

I have elected not to use any existing / sample templates etc as I wanted to learn everything from scratch. Could this be my issue? I have no Templates etc in my localhost implementation of Umbraco.

Viewing all 72689 articles
Browse latest View live