Copied to clipboard

Flag this post as spam?

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


  • Collin O'Connor 3 posts 34 karma points
    May 16, 2014 @ 20:37
    Collin O'Connor
    1

    String or binary data would be truncated error when saving a custom property editor

    (I'm using Umbraco 7.1.1)

    I have created a custom property editor that saves some data for an item in JSON format. The issue is that when the text reaches a certain character amount (around 500 or so), the error gets thrown.

    Here's the manifest file:

    {   
    propertyEditors: [      
        {
            alias: "My.LinkImageEditor",
            name: "Link Image Editor",
            editor: {
                view: "~/App_Plugins/LinkImageEditor/view.html",
                valueType: "JSON"
            }
        }
    ]
    ,
    javascript: [
        '~/App_Plugins/LinkImageEditor/controller.js'
    ]
    }
    

    If anyone has any ideas of why I can't save more data, that'd be greatly appreciated.

    Thanks

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    May 16, 2014 @ 22:50
    Jan Skovgaard
    0

    Hi Collin and welcome to our :)

    I'm not sure but I think this may be due to a limitation in the default JSON length in the web.config file.

    Try doing tweak number 2 mentioned in this article by Jeavon Leopold http://24days.in/umbraco/2013/6-easy-configuration-tweaks/

    Hope this helps.

    /Jan

  • Collin O'Connor 3 posts 34 karma points
    May 16, 2014 @ 23:17
    Collin O'Connor
    0

    Hey Jan,

    I put that XML in my web.config but it didn't seem to help. The default for the maxJsonLength is 2097152 which is well above the maximum Json I have tried to save.

    -Collin

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    May 16, 2014 @ 23:20
    Jan Skovgaard
    0

    Hi Collin

    Ok, then I'm afraid I'm clueless on this one - Hopefully one of the other bright minds in here can help you out.

    Cheers, Jan

  • Nicholas Westby 2054 posts 7103 karma points c-trib
    May 17, 2014 @ 01:10
    Nicholas Westby
    101

    I suspect you previously had the valueType either unspecified or specified in the wrong place, and that your manifest file is cached. Try rebuilding your site, restarting the app pool, clearing your browser cache, and restarting the website.

    Here is an issue somebody else had that was very similar to yours: http://issues.umbraco.org/issue/U4-3782

  • Collin O'Connor 3 posts 34 karma points
    May 19, 2014 @ 20:03
    Collin O'Connor
    0

    The app pool restart did the trick. Thanks a ton Nicholas

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Dec 23, 2014 @ 12:34
    Jeroen Breuer
    0

    I seem to be having the same issue, but setting the valueType didn't fix it. I've started a new topic here: http://our.umbraco.org/forum/umbraco-7/developing-umbraco-7-packages/59997-String-or-binary-data-would-be-truncated-with-custom-property-editor

    Jeroen

Please Sign in or register to post replies

Write your reply to:

Draft