I'm using Polyglot 2.04 with Umbraco 7.3.4 and I may have come across a bug having to do with compositions.
If I create a composition that contains the "Language" property (of type label) and compose my translation doctype from that composition, I get an error when I attempt to create translations from the context menu when right clicking a content node:
2016-02-09 18:22:52,135 [P5260/D43/T9] ERROR Dimi.Polyglot.BLL.DocumentTranslation - Translation document type does not contain the 'language' (alias) property
System.Exception: Translation document type does not contain the 'language' (alias) property
at Dimi.Polyglot.BLL.DocumentTranslation.CheckTranslationInfrastructure(Int32 nodeID)
My guess is it's looking for the "language" property on the doctype in a way that isn't compatible with compositions.
Thanks! I'm afraid I have some bad news. I am maintaining the package during my spare time and I will be a little busy this week and the next after all, so I'll be able to look into it afterwards. Sorry about that (I certainly will fix it though). In the meantime, if this is really urgent, the source code is available on GitHub (see source code link on project page). I also accept pull requests :D
No dice. Here's the error I get after upgrading to 2.05:
Here's the stack trace in the Umbraco log:
2016-02-24 08:51:14,427 [P2664/D2/T13] ERROR Dimi.Polyglot.BLL.DocumentTranslation - Sequence contains more than one element
System.InvalidOperationException: Sequence contains more than one element
at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source)
at Umbraco.Core.Persistence.Database.SingleOrDefault[T](Sql sql)
at Dimi.Polyglot.DAL.ContentType.GetPropertyList(Int32 contentTypeId, List`1 rowList)
at Dimi.Polyglot.BLL.ContentType.GetPropertyList(Int32 contentTypeId)
at Dimi.Polyglot.BLL.DocumentTranslation.<>c__DisplayClass11_0.<CheckTranslationInfrastructure>b__0(PropertyType p)
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source)
at Dimi.Polyglot.BLL.DocumentTranslation.CheckTranslationInfrastructure(Int32 nodeID)
To reproduce, I think you'll have to use a doctype that is based off of multiple compositions. Note that my other forum post (linked above) mentions the problem code and explains the reasons for it.
I see. I got an error for a single composition, which I fixed, but I didn't think of trying out more of them. Back to the drawing board! I'll return with news soon.
So, I've managed to make it fail with the same error by translating a composition of two document types. It should be ok now with the latest correction (v2.06). Let me know how it goes!
2016-02-25 15:31:59,692 [P4544/D9/T33] ERROR Dimi.Polyglot.BLL.DocumentTranslation - There is already an open DataReader associated with this Command which must be closed first.
System.InvalidOperationException: There is already an open DataReader associated with this Command which must be closed first.
at System.Data.SqlClient.SqlInternalConnectionTds.ValidateConnectionForExecute(SqlCommand command)
at System.Data.SqlClient.SqlConnection.ValidateConnectionForExecute(String method, SqlCommand command)
at System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
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:\Code\github\SamSaffron\MiniProfiler\StackExchange.Profiling\Data\ProfiledDbCommand.cs:line 248
at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader()
at Umbraco.Core.Persistence.Database.<Query>d__7`1.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at Dimi.Polyglot.DAL.ContentType.GetPropertyList(Int32 contentTypeId, List`1 rowList)
at Dimi.Polyglot.DAL.ContentType.GetPropertyList(Int32 contentTypeId, List`1 rowList)
at Dimi.Polyglot.BLL.ContentType.GetPropertyList(Int32 contentTypeId)
at Dimi.Polyglot.BLL.DocumentTranslation.<>c__DisplayClass11_0.<CheckTranslationInfrastructure>b__0(PropertyType p)
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source)
at Dimi.Polyglot.BLL.DocumentTranslation.CheckTranslationInfrastructure(Int32 nodeID)
I'm using SQL Server (2012 R2, I believe). Running from Visual Studio 2015.
Hi Nicholas! I have uploaded version 2.07 which resolves the latest issue you have mentioned. The problem hadn't occurred on my machine because I was using SQL CE. I have installed SQL Server now. Apologies for the lousy support but I hadn't really needed to make any coding modifications to the package for a couple of years and I got a little rusty :/ Let me know if everything is ok now.
Polyglot Doesn't Work with Compositions?
I'm using Polyglot 2.04 with Umbraco 7.3.4 and I may have come across a bug having to do with compositions.
If I create a composition that contains the "Language" property (of type label) and compose my translation doctype from that composition, I get an error when I attempt to create translations from the context menu when right clicking a content node:
My guess is it's looking for the "language" property on the doctype in a way that isn't compatible with compositions.
I have found more evidence of this issue here: https://our.umbraco.org/projects/backoffice-extensions/polyglot/polyglot-package-feedback-bug-reports-assistance-etc/74950-linq-sequence-error-when-attempting-translation-with-polyglot
Hi Nicholas,
You're probably right. I will have a look and correct the problem. Normally, it should just take a couple of days.
Glad to hear it. If you like, I'd be happy to spend some time testing out any solutions you come up with.
Thanks! I'm afraid I have some bad news. I am maintaining the package during my spare time and I will be a little busy this week and the next after all, so I'll be able to look into it afterwards. Sorry about that (I certainly will fix it though). In the meantime, if this is really urgent, the source code is available on GitHub (see source code link on project page). I also accept pull requests :D
Hi Nicholas! I've fixed the problem. Whenever you have some time, could you check out v2.05 and let me know if it works for you?
No dice. Here's the error I get after upgrading to 2.05:
Here's the stack trace in the Umbraco log:
This seems to be the same as the error I was getting with Polyglot 2.04: https://our.umbraco.org/projects/backoffice-extensions/polyglot/polyglot-package-feedback-bug-reports-assistance-etc/74950-linq-sequence-error-when-attempting-translation-with-polyglot
To reproduce, I think you'll have to use a doctype that is based off of multiple compositions. Note that my other forum post (linked above) mentions the problem code and explains the reasons for it.
I see. I got an error for a single composition, which I fixed, but I didn't think of trying out more of them. Back to the drawing board! I'll return with news soon.
So, I've managed to make it fail with the same error by translating a composition of two document types. It should be ok now with the latest correction (v2.06). Let me know how it goes!
I now get this error:
Here's the stack trace from my Umbraco log:
I'm using SQL Server (2012 R2, I believe). Running from Visual Studio 2015.
I think I know what's wrong. I'll fix this soon. Sorry for the delay.
Hi Nicholas! I have uploaded version 2.07 which resolves the latest issue you have mentioned. The problem hadn't occurred on my machine because I was using SQL CE. I have installed SQL Server now. Apologies for the lousy support but I hadn't really needed to make any coding modifications to the package for a couple of years and I got a little rusty :/ Let me know if everything is ok now.
Seems to work now. Thanks!
Glad to hear it! Many thanks for the feedback!
is working on a reply...