Suddenly on our production environment preview stopped working. On our acceptance environment it is working. It has worked before, so I'm not sure why it stopped working.
On the healthcheck I saw the XML Data Integrity had errors, but after fixing that the preview still didn't work.
Even though we do some special tricks it should still work. Pages without a ContentFinder and UrlProvider do work so that is the first thing I investigated. Most of them look like this:
public string GetUrl(UmbracoContext umbracoContext, int id, Uri current, UrlProviderMode mode)
{
var targetPublishedContent = umbracoContext.ContentCache.GetById(id);
if (targetPublishedContent != null)
{
Models.ContentModels.Language language;
var contentRepository = DependencyResolver.Current.GetService<IContentRepository>();
language = !umbracoContext.IsFrontEndUmbracoRequest
? contentRepository.GetAllLanguageContainers().FirstOrDefault()
: contentRepository.GetCurrentLanguageContainer();
if (language != null)
{
return umbracoContext.UrlProvider.GetUrl(language.Id).EnsureEndsWith("/")
+ this.GetUrlSegment(targetPublishedContent, language.GetCultureCached().Name);
}
}
return null;
}
I think somehow targetPublishedContent is null and that is why it isn't returning the URLs. Any idea what this could happen and only on production?
I'm using Umbraco 7.5.3. Could an upgrade to 7.5.6 help?
It seems that our runtime cache was working a bit too good. Replaced some code with request cache and now preview also seems to be working again on pages that use a ContentFinder and UrlProvider.
Maybe something changed between Umbraco 7.4 and 7.5, because there it did work with the runtime cache.
Preview suddenly stopped working
Hello,
Suddenly on our production environment preview stopped working. On our acceptance environment it is working. It has worked before, so I'm not sure why it stopped working.
On the healthcheck I saw the XML Data Integrity had errors, but after fixing that the preview still didn't work.
The preview does some special tricks you can read about here: http://24days.in/umbraco-cms/2016/umbraco-edge-case-stories/#preview
Even though we do some special tricks it should still work. Pages without a ContentFinder and UrlProvider do work so that is the first thing I investigated. Most of them look like this:
I think somehow targetPublishedContent is null and that is why it isn't returning the URLs. Any idea what this could happen and only on production?
I'm using Umbraco 7.5.3. Could an upgrade to 7.5.6 help?
Jeroen
It seems that our runtime cache was working a bit too good. Replaced some code with request cache and now preview also seems to be working again on pages that use a ContentFinder and UrlProvider.
Maybe something changed between Umbraco 7.4 and 7.5, because there it did work with the runtime cache.
Jeroen
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.