Copied to clipboard

Flag this post as spam?

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


  • Dave Pearcey 46 posts 178 karma points
    Mar 17, 2017 @ 10:11
    Dave Pearcey
    0

    Media section not working with CDN

    Hi.

    I've been importing content from an older instance of umbraco into a new one, in order to rebuild the website. I've got the content and media data imported just fine.

    The issue I'm having is the media section in the back office, media pickers, and trying to call the media pickers from the front end view do not work. I'd like to point out that RTE's are working and their imagery is showing in both the view and back office eidotrs.

    I've followed this to a tee (multiple times) https://github.com/JimBobSquarePants/UmbracoFileSystemProviders.Azure

    The error i get when trying to access media in the back office:

    NetworkError: 404 Not Found - http://[mywebsite]/umbraco/backoffice/UmbracoApi/Media/GetById?id=116299

    In the view, umbraco just returns nothing when using razor to try and display an image.

    @if (CurrentPage.HasValue("articleImages"))
    {
        var imagesList = CurrentPage.articleImages.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
        var imagesCollection = Umbraco.Media(imagesList);
    
        foreach (var image in imagesCollection)
        {
            <img src="@image.Url" />
        }
    }
    

    If i print out the articleImages field, i do have the comma seperated ID's as expected.

    Has anyone got any isnight for me?

    Thanks.

  • Dave Pearcey 46 posts 178 karma points
    Mar 17, 2017 @ 11:27
    Dave Pearcey
    0

    UPDATE:

    I've fixed the 404'ing issue. It was due to the fact that the versions hadn't inported into cmsContentVersion table in the database...

    Now i'm at a point where the media section is working, just that the images arent showing, as well as the info about said image.enter image description here

  • Dave Pearcey 46 posts 178 karma points
    Mar 17, 2017 @ 15:41
    Dave Pearcey
    1

    I've figured out the issue here (i think) but i don't know what to do to resolve it.

    The old images are saved in a different way, since the media section only recently adopted the image cropper as its default way to upload media.

    old:

    <Image id="116301" key="7f5400e1-f73d-4dfa-b35a-084530126392" parentID="116297" level="4" creatorID="0" sortOrder="3" createDate="2015-11-12T12:54:32" updateDate="2015-11-12T12:54:32" nodeName="beckham-unicef-1.jpg" urlName="beckham-unicef-1jpg" path="-1,1058,13686,116297,116301" isDoc="" nodeType="1032" writerName="admin" writerID="0" version="d42f5c72-cab1-4f4e-8c1f-e7260b6d7843" template="0" nodeTypeAlias="Image">
      <umbracoFile><![CDATA[/media/19964/beckham-unicef-1.jpg]]></umbracoFile>
      <umbracoWidth><![CDATA[1455]]></umbracoWidth>
      <umbracoHeight><![CDATA[825]]></umbracoHeight>
      <umbracoBytes><![CDATA[220068]]></umbracoBytes>
      <umbracoExtension><![CDATA[jpg]]></umbracoExtension>
    </Image>
    

    VS new:

    <Image id="175063" key="1a19f060-ccba-4a70-9d17-9673b8b248f5" parentID="116297" level="4" creatorID="0" sortOrder="4" createDate="2017-03-17T14:58:11" updateDate="2017-03-17T14:58:11" nodeName="fff.jpg" urlName="fffjpg" path="-1,1058,13686,116297,175063" isDoc="" nodeType="1032" writerName="Admin" writerID="0" version="1732e02b-91ec-4994-8dc6-22c0f7337c71" template="0" nodeTypeAlias="Image">
    

    As you can see, the file data is different. The older version just being a url and the new one being json.

    Is there any sort of repair for old imagery? surely there would have been something for when upgrading umbraco version?

Please Sign in or register to post replies

Write your reply to:

Draft