Copied to clipboard

Flag this post as spam?

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


  • Moran 285 posts 934 karma points
    Jul 09, 2014 @ 08:27
    Moran
    0

    using vorto in the media section

    Hi

    I am trying to use the vorto package in the mdeia section for a new media type. when I get to the media item i get the following error.

    this is the log

    2014-07-09 09:18:22,172 [6] ERROR Our.Umbraco.Vorto.Web.PropertyEditors.VortoPropertyEditor+VortoPropertyValueEditor - [Thread 68] Error converting DB value to Editor
    Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 0, position 0.
       at Newtonsoft.Json.JsonTextReader.ParseValue()
       at Newtonsoft.Json.JsonTextReader.ReadInternal()
       at Newtonsoft.Json.JsonTextReader.Read()
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType(JsonReader reader, JsonContract contract, Boolean hasConverter)
       at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
       at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
       at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
       at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
       at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value)
       at Our.Umbraco.Vorto.Web.PropertyEditors.VortoPropertyEditor.VortoPropertyValueEditor.ConvertDbToEditor(Property property, PropertyType propertyType, IDataTypeService dataTypeService)
  • Matt Brailsford 4125 posts 22222 karma points MVP 9x c-trib
    Jul 09, 2014 @ 10:25
    Matt Brailsford
    100

    Hi Moran,

    Vorto currently only works in the content section I'm afraid. It's on my list of things to do though.

    Many thanks

    Matt

  • Moran 285 posts 934 karma points
    Jul 09, 2014 @ 17:48
    Moran
    0

    Thanks :)

    Can't wait for the next version, great package.

  • keilo 568 posts 1023 karma points
    Aug 12, 2014 @ 13:33
    keilo
    0

    Hi Matt

    Any estimates on when support for Media section might be coming?

    cheers!

  • MK 429 posts 906 karma points
    Aug 19, 2014 @ 14:19
    MK
    0

    Hi,

    Ive created a quick fix for ver 1.2. 

    You can download it from here.

    Just replace the dll and the App_Plugins/Vorto content.

    Regards,

    Moshe

     

  • Tom 23 posts 79 karma points
    Dec 17, 2014 @ 10:45
    Tom
    1

    Bit late to the party, and inspired by Moshe, we found a smaller fix that might be helpful to someone (unless someone else has found a better way?).

    public object GetDataTypeByAlias(string contentTypeAlias, string propertyAlias)
        {
            IContentTypeComposition contentType = Services.ContentTypeService.GetContentType(contentTypeAlias);
    
            if (contentType == null)
            {
                //should be media
                contentType = Services.ContentTypeService.GetMediaType(contentTypeAlias);
            }
    
            var prop = contentType.CompositionPropertyTypes.SingleOrDefault(x => x.Alias == propertyAlias);
            if (prop == null)
                return null;
    
            var dtd = Services.DataTypeService.GetDataTypeDefinitionById(prop.DataTypeDefinitionId);
            return FormatDataType(dtd);
    
        }
    
  • Steve 140 posts 321 karma points
    Dec 18, 2014 @ 17:52
    Steve
    0

    Hi Tom,

    Could you please let me know where this code goes?

    Thanks,

    Steve

  • Tom 23 posts 79 karma points
    Dec 18, 2014 @ 19:07
    Tom
    0

    Hi Steve,

    Sorry should have made that more obvious!

    It goes in the VortoApiController, under web > controllers > VortoApiController.cs

    Hope it helps you out :)

  • Steve 140 posts 321 karma points
    Dec 18, 2014 @ 19:27
    Steve
    0

    Hi Tom,

    Thanks, but, strangely, I can't find that file (or directory) anywhere in the site (Umbraco 7.1.3 and Vorto 1.2 installed).

    If you have any advice on where to look or what might cause it not to be visible that would be great!

    Steve

     

  • Tom 23 posts 79 karma points
    Dec 18, 2014 @ 20:10
    Tom
    0

    Hi Steve, no worries, I thought you had the source code downloaded ;)

    I've built the vorto source code with the fix applied, and uploaded it here for you:

    http://we.tl/ffspUkNCqs

    However I don't think the source code is fully up to date as we had to add some methods that were missing in, so I can't guarantee it will work 100% - However we are running the same files on one of our sites and it works fine for us.

    All you should need to do is copy the files from the zip into the bin folder of the website (backup the old .dll just in case!).

    Hopefully Matt will see these posts and update the package for everyone else as I'm sure they would appreciate another feature for such an excellent package!

    Tom

  • Steve 140 posts 321 karma points
    Dec 18, 2014 @ 20:42
    Steve
    0

    Wow Tom - Thanks a lot for all of this.

    You are correct - I did not have the source code. I will try your build and get back to you once I have it up and running.

    Yes, hopefully Matt will have a look. It really is a great package and functionality in the media section would only make it better!

    Best regards,

    Steve

  • Rick 92 posts 278 karma points
    Jan 28, 2015 @ 17:10
    Rick
    0

    Hi,

    Apologies to gatecrash this - I would be really interested in seeing this if you can please make the download available again?

    Many thanks,

  • Matt Brailsford 4125 posts 22222 karma points MVP 9x c-trib
    Mar 25, 2015 @ 08:23
    Matt Brailsford
    5

    Hi Guys,

    Just thought I'd let you know that media section support has now been added in version 1.4.

    Thanks for the feedback.

    Matt

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Aug 23, 2016 @ 13:38
    Jeroen Breuer
    0

    Hello,

    I just tried to use Vorto in the media section in Umbraco 7.5.0 and 7.5.2 but I'm getting this error when I try to save:

    Received an error from the server
    An error occured
    
    The given key was not present in the dictionary.
    
    EXCEPTION DETAILS
    
    System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
    STACKTRACE
    
    at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
       at Umbraco.Core.Persistence.Repositories.MediaRepository.PersistUpdatedItem(IMedia entity)
       at Umbraco.Core.Cache.DefaultRepositoryCachePolicy`2.CreateOrUpdate(TEntity entity, Action`1 persistMethod)
       at Umbraco.Core.Persistence.Repositories.RepositoryBase`2.PersistUpdatedItem(IEntity entity)
       at Umbraco.Core.Persistence.UnitOfWork.PetaPocoUnitOfWork.Commit(Action`1 transactionCompleting)
       at Umbraco.Core.Services.MediaService.Umbraco.Core.Services.IMediaServiceOperations.Save(IMedia media, Int32 userId, Boolean raiseEvents)
       at Umbraco.Web.Editors.MediaController.PostSave(MediaItemSave contentItem)
       at lambda_method(Closure , Object , Object[] )
       at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)
       at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()
    

    I also tried this on 7.4.3 and it works there.

    Jeroen

Please Sign in or register to post replies

Write your reply to:

Draft