Copied to clipboard

Flag this post as spam?

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


  • Josip 195 posts 662 karma points c-trib
    Oct 22, 2019 @ 17:32
    Josip
    0

    Urgent help pls: 'failed to get next sibling with id=3694'

    Hi all,

    I have big problem which I have noticed after last Umbraco update, but it could be something else, I am not sure that upgrade is the reason.

    I have code where I can upload and delete images in Media section from the fronted of my website.

    I have few fields where I can upload images. For example if I try to upload 1st image its okay, than if I upload one more image, again its all good, after that If I delete 1 od this images programatically it works good and than sometimes, not always which is so wierd i get this error:

    Umbraco.Core.Exceptions.PanicException: 'failed to get last child with id=-1'
    

    In this line: IMedia uploadFile = Services.MediaService.CreateMediaWithIdentity(model.File.FileName, mediaFolderId, "Image");

    This is my code for image upload to media section:

    IMedia uploadFile = Services.MediaService.CreateMediaWithIdentity(model.File.FileName, mediaFolderId, "Image");
                    uploadFile.SetValue(Services.ContentTypeBaseServices, "umbracoFile", model.File.FileName, model.File.InputStream);
                    Services.MediaService.Save(uploadFile);
    

    If i continue after that error and than try to delete some other Image i get this error:

    Umbraco.Core.Exceptions.PanicException: 'failed to get next sibling with id=3709'
    

    On this line:

    Services.MediaService.Delete(item);
    

    Please somebody help me with this, i can provide more informations if needed for better understunding.

    BR

    Josip

  • Kevin Jump 2342 posts 14889 karma points MVP 8x c-trib
    Oct 22, 2019 @ 17:38
    Kevin Jump
    2

    Hi Josip,

    sounds like your hitting this issue (or something related to it) here https://github.com/umbraco/Umbraco-CMS/issues/6698

    it will be properly fixed in the next release 8.2.1 but the end of the issue has an updated dll, you can use to get around it.

    https://github.com/umbraco/Umbraco-CMS/issues/6698#issuecomment-543790291

  • Josip 195 posts 662 karma points c-trib
    Oct 22, 2019 @ 17:39
    Josip
    0

    Hi Kevin, thank you verry much for your super fast answer.

    You are lifesaver.

    BR

    Josip

  • OXEN 4 posts 75 karma points
    Oct 29, 2019 @ 02:45
    OXEN
    0

    same issue here.

Please Sign in or register to post replies

Write your reply to:

Draft