Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nicholas Westby 2054 posts 7103 karma points c-trib
    Feb 10, 2016 @ 02:33
    Nicholas Westby
    0

    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:

     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.

  • Nicholas Westby 2054 posts 7103 karma points c-trib
    Feb 10, 2016 @ 02:53
  • dimi309 245 posts 579 karma points
    Feb 10, 2016 @ 21:10
    dimi309
    0

    Hi Nicholas,

    You're probably right. I will have a look and correct the problem. Normally, it should just take a couple of days.

  • Nicholas Westby 2054 posts 7103 karma points c-trib
    Feb 11, 2016 @ 04:45
    Nicholas Westby
    0

    Glad to hear it. If you like, I'd be happy to spend some time testing out any solutions you come up with.

  • dimi309 245 posts 579 karma points
    Feb 12, 2016 @ 22:36
    dimi309
    0

    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

  • dimi309 245 posts 579 karma points
    Feb 23, 2016 @ 22:43
    dimi309
    0

    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?

  • Nicholas Westby 2054 posts 7103 karma points c-trib
    Feb 24, 2016 @ 16:57
    Nicholas Westby
    0

    No dice. Here's the error I get after upgrading to 2.05:

    Error

    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)
    

    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.

  • dimi309 245 posts 579 karma points
    Feb 24, 2016 @ 17:08
    dimi309
    0

    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.

  • dimi309 245 posts 579 karma points
    Feb 25, 2016 @ 21:41
    dimi309
    0

    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!

  • Nicholas Westby 2054 posts 7103 karma points c-trib
    Feb 25, 2016 @ 23:35
    Nicholas Westby
    0

    I now get this error:

    error

    Here's the stack trace from my Umbraco log:

     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.

  • dimi309 245 posts 579 karma points
    Feb 25, 2016 @ 23:39
    dimi309
    0

    I think I know what's wrong. I'll fix this soon. Sorry for the delay.

  • dimi309 245 posts 579 karma points
    Feb 28, 2016 @ 03:59
    dimi309
    100

    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.

  • Nicholas Westby 2054 posts 7103 karma points c-trib
    Feb 29, 2016 @ 19:24
    Nicholas Westby
    0

    Seems to work now. Thanks!

  • dimi309 245 posts 579 karma points
    Feb 29, 2016 @ 19:28
    dimi309
    0

    Glad to hear it! Many thanks for the feedback!

Please Sign in or register to post replies

Write your reply to:

Draft