+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / DynamicContent only showing when I'm logged in

DynamicContent only showing when I'm logged in

3 posts, 0 answered
  1. Dan Sorensen
    Dan Sorensen avatar
    256 posts
    Registered:
    13 Aug 2010
    02 Nov 2012
    Link to this post
    I built a custom module with a custom MVC widget to output the data. I used the code provided in the Module Builder examples to output a collection, nothing special.

    Here's the problem, it works perfectly if I am logged in, but when an anonymous visitor loads the page, I get an error that says, "Sequence contains no elements".

    Has anyone else had an issue with custom module content only appearing if you are logged in?

    I'm running 5.2.3700 if that matters.
    Thanks, 
    Dan
  2. Dan Sorensen
    Dan Sorensen avatar
    256 posts
    Registered:
    13 Aug 2010
    02 Nov 2012 in reply to Dan Sorensen
    Link to this post
    ...try to figure it out all evening, and I solve it 2 minutes after I post... :-P

    for whatever reason (likely I missed something in the release notes), moving from 5.0.2523 to 5.2.3700 requires that I add a line to suppress security checks in order to allow anonymous viewers. In my case, authenticated editors make changes, but anyone (anon) can view the output.

    // after
    DynamicModuleManager dynamicModuleManager = DynamicModuleManager.GetManager();

    // add this line to allow anonymous viewers to view the output
    dynamicModuleManager.Provider.SuppressSecurityChecks = true;


    Hope this helps someone. :-)
  3. Chris
    Chris avatar
    49 posts
    Registered:
    20 Jul 2010
    01 Mar 2013 in reply to Dan Sorensen
    Link to this post

    thank you for providing your solution. This helped me out!

3 posts, 0 answered