This project is read-only.

CustomForms not accessible when not logged in: 401 Unauthorized (Orchard 1.7.1)

Topics: Troubleshooting
Feb 5, 2014 at 11:24 AM
Calling a freshly created custom form using the CustomForms module, when I log out from Orchard I get the below response. Why is my custom form not accessible when I'm logged out? This is happening on an Orchard v. install.
<!DOCTYPE html>
        <title>Runtime Error</title>
    <body bgcolor="white">
            <span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>
            <h2> <i>Cannot redirect after HTTP headers have been sent.</i> </h2></span>
            <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">
            <b> Description: </b>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.
            <b> Exception Details: </b>System.Web.HttpException: Cannot redirect after HTTP headers have been sent.<br><br>
            <b>Source Error:</b> <br><br>
            <table width=100% bgcolor="#ffffcc">
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.</code>
            <b>Stack Trace:</b> <br><br>
            <table width=100% bgcolor="#ffffcc">
[HttpException (0x80004005): Cannot redirect after HTTP headers have been sent.]
   System.Web.HttpResponse.Redirect(String url, Boolean endResponse, Boolean permanent) +12715248
   System.Web.Security.FormsAuthenticationModule.OnLeave(Object source, EventArgs eventArgs) +12764280
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +165
            <hr width=100% size=1 color=silver>
            <b>Version Information:</b>&nbsp;Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18408
Feb 5, 2014 at 11:45 AM
It might be related to Output Cache module. Can you try disabling it if it's enabled?

Feb 5, 2014 at 11:10 PM
Edited Feb 5, 2014 at 11:10 PM
Hi Kassobasi,

thanks for answering but unfortunately, even after disabling the Output Cache module, I cannot save new form submissions when I'm not logged in.

I've at least gotten that far to show the form for not-logged in users by using a Custom Forms Widget in a layer I created just for the page that I want that form to show. But once I submit it I get the following:

Couldn't create content. Anonymous users do not have Submit_Rodzina permission.
Access Denied

Now, I'd like to give the Anonymous user the desired permission but where would I do that? (Rodzina is the name of my content type for which I've created the custom form.)
Feb 5, 2014 at 11:14 PM
If you go to Users -> Roles, you can grant the required permissions to the Anonymous user role.
Feb 6, 2014 at 11:03 AM
Sipke, thanks a lot for your quick help! Of course, that worked. I had no clue where to look for the permissions, I must admit... but Users -> Roles makes somewhat sense.
Cheers, Oliver