Copied to clipboard

Flag this post as spam?

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


  • marcelh 171 posts 471 karma points
    Mar 17, 2015 @ 20:50
    marcelh
    0

    DataTypeService.GetPreValueAsString throws InvalidOperationException (Sequence contains no matching elelement)

    I'm using the DataTypeService to get the "nice text" (GetPreValueAsString) for a selected dropdownlist item. But on the first load of the website, I receive the following YSOD:

    [InvalidOperationException: Sequence contains no matching element] System.Linq.Enumerable.Single(IEnumerable`1 source, Func`2 predicate) +621 Umbraco.Core.Persistence.Repositories.DataTypeDefinitionRepository.GetPreValueAsString(Int32 preValueId) +300 Umbraco.Core.Services.DataTypeService.GetPreValueAsString(Int32 id) +105

    It looks as if something is not completely initialized when the call to the DataTypeService is invoked, because I only receive this message on the first run (after building). When I access the Umbraco backend in another page and then switch back to the actual page, the page loads just fine.

    I should perhaps not that I'm using Zbu's ModelBuilder to generate strongtyped models for my document types (which works just fine).

  • Nicholas Westby 2054 posts 7100 karma points c-trib
    May 22, 2015 @ 19:41
    Nicholas Westby
    0

    A coworker of mine is periodically encountering this too. Umbraco 7.2.4. Not using Zbu's ModelBuilder.

  • Nicholas Westby 2054 posts 7100 karma points c-trib
    May 22, 2015 @ 19:51
    Nicholas Westby
    0

    Here's an Umbraco issue somebody submitted related to this: http://issues.umbraco.org/issue/U4-6289

  • Christian Thillemann 8 posts 73 karma points c-trib
    Aug 26, 2015 @ 13:37
    Christian Thillemann
    0

    I had a similar issue that I fixed by using this method instead umbraco.library.GetPreValueAsString

  • Ian Grainger 71 posts 135 karma points
    Oct 18, 2017 @ 11:30
    Ian Grainger
    0

    Woah. That fixed it for me, too...

Please Sign in or register to post replies

Write your reply to:

Draft