Copied to clipboard

Flag this post as spam?

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


  • Thomas Chance 6 posts 87 karma points
    Mar 08, 2022 @ 13:52
    Thomas Chance
    0

    Upgraded Umbraco 7 to 8 - Positional Content DB Value to Editor Error

    Hi Phil!

    We've recently taken over a website in which we upgraded the Umbraco version from 7 to 8 and it was using the Positional Content package.

    We successfully re-installed the package's new version however we are getting errors on the nodes that used the package

    Error converting DB value to Editor - {"primaryImage":{"imageId":"1717","height":865.0,"width":1920.0},"items":[{"id":0,"dimensions":{"Main":{"top":22.9145527,"bottom":21.593565,"left":27.6864624,"right":57.2992172,"width":14.998167,"widthAuto":false,"height":55.49191,"heightAuto":true,"pinToRight":false,"pinToBottom":false,"hide":false,"overrideContent":false,"overrideSettings":false,"content":null,"settings":null}},"content":"[{\"key\":\"bf35cc35-ec7b-4676-aae3-
    

    *Ive cut the error short but from what I could tell is either the storage or access of the property data has changed between the two versions (Ofcourse, not that surprising with a major version update such as this)

    I was wondering if you were aware of what had changed between the two versions in terms of how the Positional content should be stored so that we could perhaps make a script to convert the old values to the newer v8 style.

    Cheers!

    Tom

  • Thomas Chance 6 posts 87 karma points
    Mar 10, 2022 @ 14:31
    Thomas Chance
    0

    Follow up to this - Ended up fixing this after some digging so heres the answer if anyone else ends up updating to Version 8 with this plugin!

    Ultimately there is some minor differences surrounding the Config stored in the umbracoDataType and umbracoPropertyData tables.

    Very simply put:

    On the umbracoDataType config field for the property types. Simple alter any breakpoint integers that are currently being stored as "" to null. Take away the array name of "items" from the breakpoints part of the json and replace the "HideLabel" value of "1" to true or false (Your call on that one, you can always edit it in the backoffice once fixed).

    I.E

    Old storage example:

    "breakpoints": {
        "items": [
            {
                "name": "Main",
                "cropWidth": 1920,
                "cropHeight": 865,
                "breakpointUpper": "",
                "breakpointLower": ""
            }
        ]
    },
    

    Becomes

    "breakpoints": [
        {
            "name": "Main",
            "cropWidth": 1920,
            "cropHeight": 865,
            "breakpointUpper": 0,
            "breakpointLower": 0
        }
    ],
    

    This then corrects the property type so it is viewable in the backoffice.

    Then for any pages that use positional content a very similar change needs to be done in the umbracoPropertyData table, wherever this property is used, in which you replace any breakpoint values again with null or a 0. We opted to use 0's as it made sense to use integers across the board.

  • Phil Whittaker 63 posts 267 karma points MVP 2x c-trib
    Mar 23, 2022 @ 07:22
    Phil Whittaker
    0

    Hi Thomas

    Sorry for the late reply here.

    Last year I uploaded the source for v9 of positional content to a branch on my github, this should make it easier to spot the differences.

    https://github.com/hifi-agency/positional-content/tree/v7

    Phil

Please Sign in or register to post replies

Write your reply to:

Draft