Copied to clipboard

Flag this post as spam?

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


  • Neil Hodges 338 posts 987 karma points
    Oct 27, 2014 @ 17:09
    Neil Hodges
    0

    Media - An item with the same key has already been added.

    Hi

    I keep getting an error when trying to add a image to any Media folder. Ive tried adding one outside the folder as well and still get the error below:

    An item with the same key has already been added.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

    Exception Details: System.ArgumentException: An item with the same key has already been added. 

    Stack Trace: 

    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 Umbraco.Core.Media.ImageHelper.GenerateMediaThumbnails(IFileSystem fs, String fileName, String extension, Image originalImage, IEnumerable`1 additionalThumbSizes)
       at Umbraco.Web.PropertyEditors.FileUploadPropertyValueEditor.ConvertEditorToDb(ContentPropertyData editorValue, Object currentValue)
       at Umbraco.Web.Editors.ContentControllerBase.MapPropertyValues[TPersisted](ContentBaseItemSave`1 contentItem)
       at Umbraco.Web.Editors.MediaController.PostSave(MediaItemSave contentItem)
       at lambda_method(Closure , Object , Object[] )
       at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass13.<GetExecutor>b__c(Object instance, Object[] methodParameters)
       at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)
       at System.Threading.Tasks.TaskHelpers.RunSynchronously[TResult](Func`1 func, CancellationToken cancellationToken)
    Is there a way i can fix this? Do i need to flush a DB table? Delete a chach file? if so which ones?
    Any help would be greatly appreciated.
  • Charles Afford 1163 posts 1709 karma points
    Oct 27, 2014 @ 21:25
    Charles Afford
    100

    Hi it looks like you have got some custom stuff there?

    Go into Umbraco where you define custom properties for the media items.

    You have a duplicate property i would expect called AdditionalThumbSize

    Remove the duplicate and you will be all set to go.

    Sorry i cannot remember how to get there of the top my head, but pretty sure its in the setting section / media.

    Charlie :)

  • Neil Hodges 338 posts 987 karma points
    Oct 30, 2014 @ 19:21
    Neil Hodges
    0

    Hi Charles

    Yeh i created a seperate Media Type to have a Image Cropper as the Upload, therefore you would crop the image at the Media section rather than a property editor.

    Seems setting UmbracoFile borked it. I couldnt fix it, or didnt have time to try so i just created a fresh install and transfered everything over.

    Would be nice to fina out how to actually fix that but looking in the DB i couldnt see what to delete.

    Thanks for your help anyway.

    Neil.

  • Charles Afford 1163 posts 1709 karma points
    Nov 03, 2014 @ 21:04
    Charles Afford
    0

    Sorry did not see your reply :). Glad you got it fixed and thanks for marking it resolved by me :).

    Charlie

Please Sign in or register to post replies

Write your reply to:

Draft