Copied to clipboard

Flag this post as spam?

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


  • Garðar Þorsteinsson 92 posts 463 karma points
    Feb 05, 2019 @ 11:02
    Garðar Þorsteinsson
    0

    Error converting DB value to String

    Hi,

    Good job on a great package.

    We are having one issue that keeps popping up.

    Can you tell me why this error is happening ?

    Error converting DB value to String for - { "cssNamespace": "default", "breakpoints": { "Desktop": { "name": "Desktop", "cropWidth": 1200, "cropHeight": 800, "breakpointUpper": "", "breakpointLower": null, "left": 0, "right": 0, "top": 0, "bottom": 0, "scale": "4.68", "width": 100, "height": 100 }, "Tablet": { "name": "Tablet", "cropWidth": 600, "cropHeight": 500, "breakpointUpper": null, "breakpointLower": null, "left": 0, "right": 89.316239316239319, "top": 0, "bottom": 86.645299145299148, "scale": 1 }, "Mobile": { "name": "Mobile", "cropWidth": 400, "cropHeight": 300, "breakpointUpper": null, "breakpointLower": null, "left": 0, "right": 92.87749287749287, "top": 0, "bottom": 91.987179487179489, "scale": 1 } }, "dtdGuid": "00000000-0000-0000-0000-000000000000", "primaryImage": { "width": 5616, "height": 3744, "imageId": 88137 }, "editorZoom": 70 }

  • Phil Whittaker 57 posts 219 karma points c-trib
    Feb 05, 2019 @ 19:51
    Phil Whittaker
    0

    Sorry, you're having a few issues, I've just checked and it's not deserialising because the DTDguid is not correctly set. This is quite serious, it holds the reference to the property editor in use. It should always be set to a GUID value.

    Could I ask what context you are using Positional Content in (Content, LeBlender, etc) and what version of Umbraco you are using?

    If you fancy a dig around you could debug the App_Plugins\PositionalContent\positionalcontent.controller.js file, about line 70 onwards should be the area that sets the DTDguid. If you find anything here, I'll be interested to hear what's causing it!

  • Garðar Þorsteinsson 92 posts 463 karma points
    Feb 05, 2019 @ 20:31
    Garðar Þorsteinsson
    0

    Hi Phil,

    Thanks for the quick reply.

    Umbraco Version: 7.12.1 Use it with Stacked Content.

    I will dig around for now as you gave me a place to look for :)

  • Phil Whittaker 57 posts 219 karma points c-trib
    Feb 05, 2019 @ 20:45
    Phil Whittaker
    0

    Ah, I've never used it with stacked content. I'll give a try tomorrow myself.

    Let me know if you spot anything and I can get a new release out when we work out the issue

  • Phil Whittaker 57 posts 219 karma points c-trib
    Feb 06, 2019 @ 14:56
    Phil Whittaker
    0

    I've just tried Positional Content inside a Stacked Content wrapper and it all worked OK.

    Have you spotted anything?

  • Garðar Þorsteinsson 92 posts 463 karma points
    Feb 06, 2019 @ 20:49
    Garðar Þorsteinsson
    0

    I tried on a clean setup to use Stacked content with Positional Content and I had no issues. Even when I added Stacked inside of another Stacked.

    On the instance where I'm getting this errors its happening on publish.

    I tested to add 1 stacked control on a node with a position content image.

    On publish I got a lot of error logs but everything seems to work fine in the backoffice and on the frontend.

    First I get:

        ERROR Hifi.PositionalContent.PositionalContentPropertyEditor+PositionalContentPropertyValueEditor - Error converting DB value to Editor - {
      "cssNamespace": "default",
      "breakpoints": {
        "Desktop": {
          "name": "Desktop",
          "cropWidth": 1200,
          "cropHeight": 800,
          "breakpointUpper": 4000,
          "breakpointLower": 1050,
          "left": 23.061013443640125,
          "right": 40.650866080661849,
          "top": 8.1491712707182327,
          "bottom": 59.644837707182319,
          "scale": 1,
          "width": 36.241274560496379,
          "height": 32.28375345303867
        },
        "Tablet": {
          "name": "Tablet",
          "cropWidth": 600,
          "cropHeight": 500,
          "breakpointUpper": 1049,
          "breakpointLower": 600,
          "left": 19.441571871768357,
          "right": 62.415951396070312,
          "top": 4.5580110497237571,
          "bottom": 75.295700966850831,
          "scale": 1,
          "width": 18.119829369183041,
          "height": 20.176536602209943
        },
        "Mobile": {
          "name": "Mobile",
          "cropWidth": 400,
          "cropHeight": 300,
          "breakpointUpper": 599,
          "breakpointLower": 0,
          "left": 24.715615305067217,
          "right": 63.22394002068252,
          "top": 7.872928176795579,
          "bottom": 80.112620856353587,
          "scale": 1,
          "width": 12.079886246122026,
          "height": 12.105058701657459
        }
      },
      "dtdGuid": "aeaf1225-d4b7-4652-b391-c26e860cb4bb",
      "primaryImage": {
        "width": 3311,
        "height": 2480,
        "imageId": 91812
      },
      "editorZoom": 70
    }
    

    And Then

    System.Exception: Exception while creating a value. ---> System.NullReferenceException: Object reference not set to an instance of an object.
       at Hifi.PositionalContent.PositionalContentHelper.<>c__DisplayClass3_0.<GetTargetDataTypeDefinition>b__0()
       at Umbraco.Core.Cache.DictionaryCacheProviderBase.<>c__DisplayClass10_0.<GetSafeLazy>b__0()
       --- End of inner exception stack trace ---
       at Umbraco.Core.Cache.HttpRuntimeCacheProvider.GetCacheItem(String cacheKey, Func`1 getCacheItem, Nullable`1 timeout, Boolean isSliding, CacheItemPriority priority, CacheItemRemovedCallback removedCallback, CacheDependency dependency)
       at Umbraco.Core.Cache.HttpRuntimeCacheProvider.GetCacheItem(String cacheKey, Func`1 getCacheItem)
       at Umbraco.Core.Cache.DeepCloneRuntimeCacheProvider.GetCacheItem(String cacheKey, Func`1 getCacheItem)
       at Hifi.PositionalContent.PositionalContentHelper.GetTargetDataTypeDefinition(Guid myId, String property)
       at Hifi.PositionalContent.PositionalContentHelper.GetDataTypeToDb(Guid dtdGuid, String property, Boolean from)
       at Hifi.PositionalContent.PositionalContentPropertyEditor.PositionalContentPropertyValueEditor.AssignValuesToDb(PositionalContentModel content, IDataTypeService dataTypeService, Func`4 valueProcessor)
       at Hifi.PositionalContent.PositionalContentPropertyEditor.PositionalContentPropertyValueEditor.ConvertEditorToDb(ContentPropertyData editorValue, Object currentValue)
     [P20916/D2/T29] INFO  Umbraco.Core.Publishing.PublishingStrategy - Content 'test positinal content' with Id '106446' has been published.
     [P20916/D2/T29] ERROR Hifi.PositionalContent.PositionalContentPropertyEditor+PositionalContentPropertyValueEditor - Error converting DB value to String for - {
      "cssNamespace": "default",
      "breakpoints": {
        "Desktop": {
          "name": "Desktop",
          "cropWidth": 1200,
          "cropHeight": 800,
          "breakpointUpper": 4000,
          "breakpointLower": 1050,
          "left": 23.061013443640125,
          "right": 40.650866080661849,
          "top": 8.1491712707182327,
          "bottom": 59.644837707182319,
          "scale": 1,
          "width": 36.241274560496379,
          "height": 32.28375345303867
        },
        "Tablet": {
          "name": "Tablet",
          "cropWidth": 600,
          "cropHeight": 500,
          "breakpointUpper": 1049,
          "breakpointLower": 600,
          "left": 19.441571871768357,
          "right": 62.415951396070312,
          "top": 4.5580110497237571,
          "bottom": 75.295700966850831,
          "scale": 1,
          "width": 18.119829369183041,
          "height": 20.176536602209943
        },
        "Mobile": {
          "name": "Mobile",
          "cropWidth": 400,
          "cropHeight": 300,
          "breakpointUpper": 599,
          "breakpointLower": 0,
          "left": 24.715615305067217,
          "right": 63.22394002068252,
          "top": 7.872928176795579,
          "bottom": 80.112620856353587,
          "scale": 1,
          "width": 12.079886246122026,
          "height": 12.105058701657459
        }
      },
      "dtdGuid": "aeaf1225-d4b7-4652-b391-c26e860cb4bb",
      "primaryImage": {
        "width": 3311,
        "height": 2480,
        "imageId": 91812
      },
      "editorZoom": 70
    }
    
  • Phil Whittaker 57 posts 219 karma points c-trib
    Feb 06, 2019 @ 21:11
    Phil Whittaker
    0

    Mmmm, stranger and stranger. This looking like a different error now but it's still related to the DTDguid not being recognised by the system.

    This is the code that's erroring, it's pretty much standard Umbraco.

                    var services = ApplicationContext.Current.Services;
                    var dtd = services.DataTypeService.GetDataTypeDefinitionById(myId);
                    var preValues = services.DataTypeService.GetPreValuesCollectionByDataTypeId(dtd.Id).PreValuesAsDictionary;
                    DataTypeInfo dataType = null;
                    if (preValues[property].Value == null || preValues[property].Value == "None")
                        return null;
                    else
                        dataType = JsonConvert.DeserializeObject<DataTypeInfo>(preValues[property].Value);
    

    Is there any way you can send over cut down a version of the site in question and I can take a closer look.

  • Garðar Þorsteinsson 92 posts 463 karma points
    Feb 06, 2019 @ 21:16
    Garðar Þorsteinsson
    0

    I will see what I can do tomorrow about it.

    Its rather large system but I think I can strip it down to these functions and give you access to that.

    Appreciate your help.

Please Sign in or register to post replies

Write your reply to:

Draft