Copied to clipboard

Flag this post as spam?

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


  • Steven Lemmens 4 posts 78 karma points
    May 12, 2019 @ 10:33
    Steven Lemmens
    5

    Possible caching error: "Umbraco.Web.PublishedModels.Image"

    Hi,

    I sometimes get the following error. Restarting my Umbraco v8 completely solves it for a while. It seems to return randomly after I have made changes to the document type of said page, so I guess it has something to do with caching ?

    The error is:

    The value "Umbraco.Web.PublishedModels.Image" is not of type "Umbraco.Web.PublishedModels.Image" and cannot be used in this generic collection.
    Parameter name: value
    

    And this is the code this error is triggered on:

    @{
       var img =  Model.Value<IPublishedContent>("boekomslag2");
     }
    

    "boekomslag2" is a property of type Media Picker, and has a real image selected.

    You can also get a similar error if you go to Media, create a new "File" and upload an image. Umbraco seems to recognize that it is indeed an image, because you can select this media item in your Media Picker, even though this proeprty is set "Pick only images". But as soon as you select your "File", it generates a very similar error.

    Any ideas ?

  • Murat 3 posts 73 karma points
    May 15, 2019 @ 19:04
    Murat
    0

    I upgraded to 8.0.2 and any changed code behind it returns the same error and restart on iis solves the problem

  • Arnim Anhut 137 posts 148 karma points
    Jun 06, 2019 @ 13:32
    Arnim Anhut
    0

    Also 8.0.2 and having the same issue.

    Is there a solution to this error?

  • Jojo V 64 posts 166 karma points
    Jun 06, 2019 @ 14:34
    Jojo V
    1

    For me stop / start IIS ( not restart )

  • fede 2 posts 71 karma points
    Jun 06, 2019 @ 14:46
    fede
    0

    I'm also having this problem

    The value "Umbraco.Web.PublishedModels.Image" is not of type "Umbraco.Web.PublishedModels.Image" and cannot be used in this generic collection. Parameter name: value Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.ArgumentException: The value "Umbraco.Web.PublishedModels.Image" is not of type "Umbraco.Web.PublishedModels.Image" and cannot be used in this generic collection. Parameter name: value

    Source Error:

    Line 318: [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder", "8.0.4")] Line 319: [ImplementPropertyType("photos")] Line 320: public Image Photos => this.Value("photos"); Line 321: Line 322: ///

  • Chris 12 posts 84 karma points
    Jun 11, 2019 @ 08:42
    Chris
    0

    I have found this bug appears if you select images only in the multiple media picker settings.

    Temporary workaraound:

    You can copy the folder in settings > media types and set the permissions on your new folder to only accept images, then in media create a folder of the new type.

    If you make the multiple media picker point to that folder then the editor can only choose files that have been uploaded to that folder which you have set to only allow images.

  • Blake Watt (Clerke) 106 posts 351 karma points MVP
    Jun 13, 2019 @ 17:59
    Blake Watt (Clerke)
    0

    I'm running into this too on v8.0.2. I have a media picker that is set to "pick only images" (not a multiple image picker). I have an image selected on that property and the following code returns the same error.

    var node = Model.Value<IPublishedContent>("image");
    

    Error Message The value "Umbraco.Web.PublishedModels.Image" is not of type "Umbraco.Web.PublishedModels.Image" and cannot be used in this generic collection. Parameter name: value

    The only "fix" I've found was to touch the web.config and the image showed up and the error was gone. Not sure if that will happen every time. I definitely think this is a bug with how many people are having the same issue. Do you know if this has been reported on the issue tracker?

    Update: I didn't find the issue listed on the issue tracker, this issue is closed but it was the closest thing I could find and I posted there. I think it might be a similar issue.

  • Mads Sørensen 188 posts 433 karma points
    Jul 10, 2019 @ 08:01
    Mads Sørensen
    0

    Had exact same senario and problem. Kicking the web.config solved the problem :)

  • steschu 88 posts 489 karma points
    Jun 15, 2019 @ 09:12
    steschu
    2

    I have the same problem. As Blake Clerke says, saving the web.config will fix it temporaryly, but obviously there is a danger that the error can show up after changing content. And when this is done by my customer he/she is not able to save the web.config.

    So, does anybody know if this will be fixed?

  • Tor Langlo 189 posts 532 karma points
    Jun 15, 2019 @ 17:55
    Tor Langlo
    0

    This might be a problem with how asp.net is compiling the website after changes to the site. I'm not able to accurately describe the situation, but I'm regularly getting "Cannot bind source type LangloStore.ViewModels.ProductViewModel to model type LangloStore.ViewModels.ProductViewModel" type error on my local environment, and just now got it on our Dev environment in Umbraco Cloud. I've had it happen while debugging in VS before and have seen that the 2 types (with same name and should be) are loaded from different assemblies in asp.net's directories.

    In my case, which is different from the issue here, it's unreated to image pickers, I'm using Umbraco 7.15, ModelBuilder in AppData mode, and Website project (required by Umbraco Cloud).

    Forcing asp.net to recompile the site always fixes the problem, but obviously that is not something we want to do very often on our live site.

    -Tor

  • Luke Hook 45 posts 175 karma points c-trib
    Jul 11, 2019 @ 09:20
    Luke Hook
    0

    Just to add another notch on the bedpost I too am experiencing this issue.

    I've just upgraded to 8.1 and will monitor if this is still occurring (I can't remember if I've seen it since or not).

    Luke

  • steinar mar 3 posts 73 karma points
    Aug 08, 2019 @ 19:42
    steinar mar
    0

    Just experienced this strange behavior. I am running 8.1.1 and restarting the server made it go away.

  • Allan 42 posts 192 karma points
    Nov 22, 2019 @ 14:48
    Allan
    0

    Same problem...

    Issue was raised (and closed) here - https://github.com/umbraco/Umbraco-CMS/issues/5582

    QUOTE: 'The problem is using Custom Media Types in Media Picker when "Pick only images" is on.'

    I don't have Custom Media Types, but I did have "Pick only images" on. Have switched off and will report back if the problem pops up again...

Please Sign in or register to post replies

Write your reply to:

Draft