Adding or Editing Quick Tab: item with same key already added

2 years ago
Hello, I've scanned the FAQ and read the various threads with seemingly the same issue: "item with same key already added". However, they're either from 2014 or don't pertain to my situation. I have pasted the message from my admin's error log below. It happens when I try to edit an existing tab (via 7Spikes Nop Quick Tabs plug-in) or create a new tab and try to save it. I'm on NOP version 3.8.

My backend guy thought it was because many tabs shared the same system name, so he prefixed all the identical tab names with a number, to ensure they were unique. But it's still failing. (I don't know how new tabs could be created with the same system name in the first place, I'd think there be a flag raised at that stage).

Any thoughts?

Error
An item with the same key has already been added.

System.ArgumentException: An item with the same key has already been added. at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer) at SevenSpikes.Nop.Conditions.Services.ConditionService.vStbD0VRPD(EntityType ) at SevenSpikes.Nop.Conditions.Services.ConditionService.GetConditionByEntityTypeAndEntityId(EntityType entityType, Int32 entityId, Boolean isActive) at SevenSpikes.Nop.Conditions.Controllers.ConditionsAdminController.Create(EntityType entityType, Int32 entityId, IDictionary`2 availableConditionTypes, Boolean active, Boolean defaultGroupState) at lambda_method(Closure , ControllerBase , Object[] ) at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End() at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__32(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End() at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult)
2 years ago
Hello,

The error you are getting is not because you have many tabs with the same System Name. It is actually caused by duplicate results in the dbo.SS_C_EntityCondition table in your database. In the past, this issue had to be fixed by deleting manually the records with the same EntityType - EntityId pair from that table.
However, we have implemented fixes in our products that fix this issue if it occurs in our client stores
I see you are using nopCommerce 3.80. Can you submit a ticket with your plugin's version so we can advise you what is the best solution for you?

Regards,
Anton