Copied to clipboard

Flag this post as spam?

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


  • nandoDel 8 posts 98 karma points
    Oct 19, 2017 @ 20:59
    nandoDel
    0

    Error in GetOtherUrls method

    Hi Jeroen, i have downloaded the oct 4/2017 version of https://our.umbraco.org/projects/developer-tools/1-1-multilingual-example/. The project works well, but implementing it in my own project to get different urls per node in two languages: English and spanish i'am getting the following error in the GetOtherUrls method. specifically in this code:

    for (int i = 0; i < domains.Count; i++)
    {
                 // Get the domain and matching parent url.
                  var otherDomain = domains[i];
                  var otherParentUrl = parentUrls[i];
                 // Get the parent url and add the url segment of this culture.
                 var urlSegment = content.GetUrlSegment(otherDomain.LanguageIsoCode);
                                        urls.Add(otherParentUrl.EnsureEndsWith("/") + urlSegment);
      }
    

    in the line : var otherParentUrl = parentUrls[i];

    this is the exception:

    System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) at System.Collections.Generic.List1.get_Item(Int32 index) at Umbraco.Extensions.UrlProviders.MultilingualUrlProvider.<>c__DisplayClass1_0.<GetOtherUrls>b__0() in C:\Projects\NET\PolancoPlastica\PolancoPlasticaWebPage\PolancoPlastica\Umbraco.Extensions\UrlProviders\MultilingualUrlProvider.cs:line 144 at Umbraco.Core.Cache.CacheProviderExtensions.<>c__DisplayClass5_01.

    any help would be very appreciated,

Please Sign in or register to post replies

Write your reply to:

Draft