webadvanced / Orchard-SiteMap

SiteMap module for Orchard CMS
14 stars 21 forks source link

Sitemaps not working on Orchard 1.7 RC #13

Open robertmclaws opened 11 years ago

robertmclaws commented 11 years ago

Hello,

I'm using your plug-in on Orchard 1.7RC on my site. I can access the sitemap.xml from a browser, but when I use Fiddler to ping it, or try to hit any other sitemap validating service, it returns a 200OK with no payload.

You can try it for yourself at http://advancedrei.com/sitemap.xml.

Any ideas?

Thanks!

-Robert McLaws

CPyle commented 11 years ago

I get an empty XML response in the browser as well. Have you selected anything to be indexed for the xml sitemap yet, or made any custom routes?

-Chris

On Mon, Jul 22, 2013 at 7:35 PM, AdvancedREI notifications@github.comwrote:

Hello,

I'm using your plug-in on Orchard 1.7RC on my site. I can access the sitemap.xml from a browser, but when I use Fiddler to ping it, or try to hit any other sitemap validating service, it returns a 200OK with no payload.

You can try it for yourself at http://advancedrei.com/sitemap.xml.

Any ideas?

Thanks!

-Robert McLaws

— Reply to this email directly or view it on GitHubhttps://github.com/webadvanced/Orchard-SiteMap/issues/13 .

robertmclaws commented 11 years ago

I figured it out. The sitemap is not visible to the Anonymous role. The reason I could see it is that I was logged into the console and opened the sitemap up in another tab.

The Roles editor only has the option to enable sitemap editing in the Anonymous role... any idea how I make the sitemap visible when you're not logged in?

robertmclaws commented 11 years ago

Any update on this? Thanks!

CPyle commented 11 years ago

The module doesn't do any access checking at all outside of the admin screen. Being logged in shouldn't be required.

Our website's sitemap at http://www.webadvanced.com/sitemap.xml uses my module and works fine anonymously. If it was blocked, you would get an HTTP Unauthorized response or be redirected to the login screen. Are you sure you've gone to the sitemap settings and checked "Index for XML" next to the content types you want to show up?

On Sat, Jul 27, 2013 at 9:08 PM, AdvancedREI notifications@github.comwrote:

Any update on this? Thanks!

— Reply to this email directly or view it on GitHubhttps://github.com/webadvanced/Orchard-SiteMap/issues/13#issuecomment-21676905 .

nicnicnic commented 11 years ago

Hi,

I'm having the same issue when installing the module in Orchard 1.7. The sitemap.xml file won't load for anonymous users, and I can't enable it in the Roles section.

robertmclaws commented 11 years ago

I believe the problem has to do with an error happening in the code, and a blank document being passed in from the cache. The reason being that calling /sitemap throws a 500 error when you're not sharing anything with the sitemap display, and I also believe unpublished content might be a factor. I'm attempting to debug through it in my environment, but I'm running into other issues. Hope to have an update (and possibly a pull request) in a few hours.

robertmclaws commented 11 years ago

I spent the better part of 3 days trying to track this down. I looked at every permutation I could, tried logging errors, and numerous other options. The only thing I could come up with is that I had "runManagedModulesForAllRequests" turned on in the web.config, which triggered some kind of security mechanism, I wasn't able to find out what. The XmlAction wrote the document, which was properly configured, but something further down the pipeline cleared the response buffer. The solution is to set it to false.

Would be nice if someone could figure out what caused this, but for now I'm going to call it a day.

HTH

robertmclaws commented 11 years ago

Actually, I take it back. That did not fix it. I was still logged in. This is seriously driving me crazy.

CPyle commented 11 years ago

Well, I appreciate the effort. I've been really busy with work for the last couple weeks (this isn't always the case) but I'll take a look at this when I can sometime soon.

robertmclaws commented 11 years ago

No worries. I don't believe it is actually your fault. I stepped through the code and it should be working. Something happens to the Response in between your code and when it renders for an anonymous user. I suspected maybe you weren't closing the reader or flushing it, but I did those things and that didn't help. I'm pretty convinced it is an Orchard Core issue.

CPyle commented 11 years ago

I have confirmed that the Core Feeds module is exhibiting the same problem. This is an issue introduced into the RC build, somehow, and seems to be affecting any action that outputs XML results.

robertmclaws commented 11 years ago

The Orchard team has a bug open for a related issue here: https://orchard.codeplex.com/workitem/19963

CPyle commented 11 years ago

It's confirmed now that disabling Output Cache will solve this issue. I'm going to hope this is fixed in 1.7.1.

Jetski5822 commented 9 years ago

Easy fix.

    [OutputCache(Duration = 0, NoStore = true)]
    public ActionResult Xml() {
        return new XmlResult(_sitemapService.GetPublicSitemapDocument());
    }
dsghi commented 9 years ago

That's not a fix, it's a workaround, the module should work with output caching...