Copied to clipboard

Flag this post as spam?

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


  • Marco 13 posts 109 karma points
    Jun 22, 2017 @ 20:25
    Marco
    0

    String "2293" is not a valid udi, using image in template in 7.6.3

    Hi,

    I recently upgraded an umbraco site from 7.4.3 to 7.6.3, but I couldn't get an image on my pages using a page template.

    • In the UmbracoSetting.config, EnablePropertyValueConverters is set to true
    • I added a new media picker (not the obsolete one) to a new document type and uploaded and assigned new images.
    • I have republished all the pages
    • I cleaned the cache via /Umbraco/dialogs/republish.aspx?xml=true
    • IIS reset etc.

    My template is like:

    IPublishedContent pageImage = CurrentPage.GetPropertyValue<IPublishedContent>("pageImage");
    
    if (pageImage != null)
    { 
        <img src="@pageImage.Url" />
    }
    

    But I still get the error String "2293" is not a valid udi, but I don't understand why. How can I check if the images have a Uid assigned? I couldn't find it in the database. I'm not sure whether the image, the page or something else is the problem.

    Thank you!

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    Jun 22, 2017 @ 21:53
    Alex Skrypnyk
    0

    Hi Marco

    Try this code:

    IPublishedContent pageImage = Model.Content.GetPropertyValue<IPublishedContent>("pageImage");
    

    Thanks,

    Alex

  • Marco 13 posts 109 karma points
    Jun 23, 2017 @ 06:10
    Marco
    0

    Hi Alex,

    Unfortunately, I get the same error. Do you have other suggestions?

    Thanks.

  • Marco 13 posts 109 karma points
    Jun 23, 2017 @ 18:20
    Marco
    101

    Found it!

    When you add a new media picker to the document template, make sure to select the correct one. There are two both called the same, with the same icon. Make sure you have the correct one:

    Media editor

    I hope this helps someone.

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    Jun 23, 2017 @ 20:21
    Alex Skrypnyk
    0

    Hi Marco

    Great that you shared a solution, have a nice weekend.

    Alex

Please Sign in or register to post replies

Write your reply to:

Draft