Copied to clipboard

Flag this post as spam?

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


  • Damien Holley 180 posts 541 karma points
    Aug 29, 2020 @ 07:33
    Damien Holley
    0

    Umbraco 8 sorting children fails

    Hi, getting a wierd one here, sort the children of a siteroot just doesn't work, it comes up with a "Failed to sort content" message . In the js it seems to get a bad request (400) when sending to https://localhost:44304/umbraco/backoffice/UmbracoApi/Content/PostSort

    in the response it says unexpected character at line 1 column1 of the json.

    On looking at the request response it is

    {"parentId":"1064","idSortOrder":[1071,1138,1156,1180,1179]}
    

    Which seems to me to be correct.

  • Damien Holley 180 posts 541 karma points
    Aug 31, 2020 @ 10:47
    Damien Holley
    0

    Any ideas guys?

  • Dee 118 posts 338 karma points
    Aug 31, 2020 @ 12:25
    Dee
    0

    Hey Damien,

    please share your code. How are you trying to achieve the content sort?

    Dee

  • Damien Holley 180 posts 541 karma points
    Aug 31, 2020 @ 12:31
    Damien Holley
    100

    Hi Dee, This was using the backoffice to sort child nodes, I have tracked the bug and put a note into the bug forum, however I will post it here as well.

    I have code that stops a user from deleting required nodes, while allowing child nodes to be removed.

    As soon as I got this error I put breakpoints in my code and checked to see if this was being hit. It was not. I also commented out my code, rebuilt and tried it again, still no luck.

    It was not until I did a full reboot and started it again later, then my breakpoints were getting hit all of a sudden when I sorted, so I stepped through that and allowed them to be saved (I don't want duplicate nodes either for these), and hey presto it works.

    So I suspect somehow it was caching my node delete prevention code, so my breakpoints were not being hit, but the code was interfering with the sort (as it tried to stop someone saving a second node).

    Thanks for the reply Dee, only got it 20 minutes ago.

  • Dee 118 posts 338 karma points
    Aug 31, 2020 @ 12:32
    Dee
    0

    Nice!

Please Sign in or register to post replies

Write your reply to:

Draft