-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
An error occurred while trying to Add language #11427
Comments
An item with the same key has already been added. Key: pa the language is already inserted. is it shown in the list of languages ? |
Hi @codekenjin .. Can you try to execute this on your setup
and ensure that do not fail, as I cannot reproduce your problem on my setup. |
There is no language list to show for me and I tried to "Add language" before I add anything. So don't know why. |
Hi bergmania, May I know where I should put your script to execute? Thanks. |
@codekenjin It doesn't matter.. You could put in a template/view like this:
Ensure it does work and please post the outcome here :) |
@bergmania aa |
Cool thanks :) Then I think the solution is to use this code :) PR Incoming.. |
Ensure there can't be duplicate culture codes in languages dropdown
Which exact Umbraco version are you using? For example: 8.13.1 - don't just write v8
9.0.1
Bug summary
An error occurred when clicked on Settings->Languages->Add language
Specifics
URL:https://localhost:44303/umbraco#/settings/languages/edit/-1?create=true
Browsers: Chrome v94.0.4606.81 & Firefox v93.0
Error message:
Received an error from the server
An error occurred
An item with the same key has already been added. Key: pa
Exception Details
System.ArgumentException, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e: An item with the same key has already been added. Key: pa
Stacktrace
at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable
1 source, Func
2 keySelector, Func2 elementSelector, IEqualityComparer
1 comparer)at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable
1 source, Func
2 keySelector, Func`2 elementSelector)at Umbraco.Cms.Web.BackOffice.Controllers.LanguageController.GetAllCultures()
at lambda_method911(Closure , Object , Object[] )
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
Steps to reproduce
Click on Settings->Languages->Add language
Expected result / actual result
Expected result: A list of languages for choosing
Actual result: Error occurred, no language for choosing
The text was updated successfully, but these errors were encountered: