Copied to clipboard

Flag this post as spam?

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


  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Jul 29, 2016 @ 12:18
    Jeavon Leopold
    0

    Error: An error has occurred. - Length cannot be less than zero. Parameter name: length

    Umbraco v7.4.3 uSync v3.1.4.740 uSync.Core v5.3.5.740

    When attempting a import I am getting the following error message:

    Error: An error has occurred. - Length cannot be less than zero.  Parameter name: length
    

    I think it maybe because the dictionary uSync config files are not containing any child nodes as they have been created for many languages but have no content yet.

    For example:

    <?xml version="1.0" encoding="utf-8"?>
    <DictionaryItem Key="Accessibility_Change_Gallery_Based_On_Option" />
    

    But it should be more like:

    <?xml version="1.0" encoding="utf-8"?>
    <DictionaryItem Key="Article_QR_NoProducts">
      <Value LanguageId="1" LanguageCultureAlias="en-US"><![CDATA[No product picked]]></Value>
      <Value LanguageId="2" LanguageCultureAlias="en-GB"><![CDATA[No product picked]]></Value>
      <Value LanguageId="3" LanguageCultureAlias="de-DE"><![CDATA[Kein Produkt ausgewählt]]></Value>
      <Value LanguageId="4" LanguageCultureAlias="fr-FR"><![CDATA[Aucun résultat]]></Value>
      <Value LanguageId="5" LanguageCultureAlias="nl-NL"><![CDATA[Geen product geselecteerd]]></Value>
      <Value LanguageId="6" LanguageCultureAlias="nb-NO"><![CDATA[Velg Produkt]]></Value>
      <Value LanguageId="7" LanguageCultureAlias="sv-SE"><![CDATA[Ingen produkt vald]]></Value>
      <Value LanguageId="8" LanguageCultureAlias="da-DK"><![CDATA[Der er ikke valgt et produkt]]></Value>
      <Value LanguageId="9" LanguageCultureAlias="fi-FI"><![CDATA[Yhtään tuotetta ei valittu]]></Value>
      <Value LanguageId="10" LanguageCultureAlias="cs-CZ"><![CDATA[Nebyl vybrán žádný produkt]]></Value>
      <Value LanguageId="11" LanguageCultureAlias="pl-PL"><![CDATA[Nie wybrano produktu]]></Value>
      <Value LanguageId="12" LanguageCultureAlias="en-IE"><![CDATA[No product picked]]></Value>
      <Value LanguageId="13" LanguageCultureAlias="ru-RU"><![CDATA[Не выбрано изделие]]></Value>
      <Value LanguageId="14" LanguageCultureAlias="es-ES"><![CDATA[No se ha seleccionado ningún producto]]></Value>
      <Value LanguageId="15" LanguageCultureAlias="it-IT"><![CDATA[Nessun prodotto scelto]]></Value>
      <Value LanguageId="16" LanguageCultureAlias="tr-TR"><![CDATA[Hiçbir ürün seçilmedi]]></Value>
    </DictionaryItem>
    

    Still investigating, anyone else seen this happen?

    Jeavon

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    Jul 29, 2016 @ 12:38
    Kevin Jump
    0

    hi

    is there anything in the umbracotracelog ?

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Jul 29, 2016 @ 12:40
    Jeavon Leopold
    0

    No it doesn't, but it certainly is this, a dictionary item without any content in any language, adding content into at least one language of every item is a workaround.

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    Jul 29, 2016 @ 17:33
    Kevin Jump
    0

    Hi

    Struggling to reproduce this :(

    I've create dictionary empty dictionary items, export and imported them, deleted them and imported new ones. all with no values in the xml

    <?xml version="1.0" encoding="utf-8"?>
    <DictionaryItem Key="thing" />
    

    the dictionary code is here : https://github.com/KevinJump/uSync/blob/Dev-v7_4/Jumoo.uSync.Core/Serializers/DictionarySerializer.cs#L42 nothing has changed in the serializer for a while :(

    Still playing around with it, to see if i can get it to trigger somehow.

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Jul 29, 2016 @ 17:36
    Jeavon Leopold
    0

    Darn, that is exactly what I've been seeing and ensuring all the languages were there as child nodes in the config file did get the "Report" to work properly, I didn't actually try to "Import"...

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    Jul 29, 2016 @ 18:41
    Kevin Jump
    0

    Humm

    When you call report, it doesn't actually call any of the import stuff, it actually does an export (if anything exists) as it creates an XML version of what is in umbraco and compares it to the XML from disk.

    this means it could be failing on Serialize ( https://github.com/umbraco/Umbraco-CMS/blob/75c2b07ad3a093b5b65b6ebd45697687c062f62a/src/Umbraco.Core/Services/PackagingService.cs#L1101 )

    Which in turn calls the umbraco package service to get the xml (which in turn calls the EnitiyXMLService - https://github.com/umbraco/Umbraco-CMS/blame/75c2b07ad3a093b5b65b6ebd45697687c062f62a/src/Umbraco.Core/Services/EntityXmlSerializer.cs#L184)

    None of that seems like it might cause this, but it's possible the dictionary items aren't in properly (from their first import) and this is triggering something.

    if you get a chance can you put debug logging on for uSync (in the log4net.config)

      <logger name="Jumoo.uSync">
        <level value="Debug" />
      </logger>
    

    and see if that gives us any more information.

    K

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Aug 04, 2016 @ 12:16
    Jeavon Leopold
    0

    Hi Kevin,

    This does seem to be fixed in the latest version, thanks!

    I think there maybe an issue with the "details" display for languages, it often seems to show the wrong culture, we will have a look at this.

    But could you clarify the process for importing dictionary items in terms of which content is taken if the content in Umbraco differs to the content in the uSync import file?

    Thanks,

    Jeavon

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    Aug 04, 2016 @ 12:48
    Kevin Jump
    0

    Cool,

    I will have a look at details, the way it displays changes is slightly different than how they are applied (it's looking at xml, and trying to find changes, the actual import process does it against the db).

    the default uSync behavior for dictionary items is to bring everything it can in from the sync files, that means new things are imports, existing things overwritten and missing values should be removed.

    Dictionary exports contain all the children of an entry in one file, so they are imported based on the parent (but they should still notice changes in and sort out children)

    A couple of people have written diffrent dictionary handlers to do change only syncs https://github.com/KevinJump/uSync/issues/26 if you don't want uSync to be so aggressive.

    I am slowly adding things to usync that will allow us to put more options like this into all handlers.

    Kevin,

Please Sign in or register to post replies

Write your reply to:

Draft