SaaS CMS has officially launched! Learn more now.

Issue with upgrade to Epi 11 aroud Page Refernces


We're working to upgrade Epi 10 CMS to 11. We have alot of code like below.

When we run the site, landingPageConfig.GetLandingPageReference("AccessRequestForm"); now comes back NULL without any other changes to the site code, for the most part.

Where there big changes in Content Loading that we should know about?

        public Guid AccessRequestFormGuid
                var landingPageConfig = ServiceLocator.Current.GetInstance<Business.ContentConfiguration.ILandingPageConfiguration>();
                var contentLoader = ServiceLocator.Current.GetInstance<IContentLoader>();
                var accessRequestFormReference = landingPageConfig.GetLandingPageReference("AccessRequestForm");
                var requestPageData = contentLoader.Get<StandardPage>(accessRequestFormReference);
                var formBlock = contentLoader.GetItems(requestPageData.MainContentArea.Items.Select(i => i.ContentLink), new LoaderOptions { LanguageLoaderOption.FallbackWithMaster() }).OfType<FormContainerBlock>().FirstOrDefault();

                return formBlock.Content.ContentGuid;

Dec 03, 2018 21:48

Hi Paul

You can review any breaking changes for CMS 11 here:

Its probably worth looking at the implementation of Business.ContentConfiguration.ILandingPageConfiguration as this is not an Episerver component so see what this is doing and see why its returning null. The IContentLoader implementation doesn't appear to be being used as part of landingPageConfig in the code you have pasted in.


Dec 03, 2018 23:02

Hey David, thanks for the answer.

We think it stems from a change in behavior of StructureMap. Once we constructed this class directly, the problem was gone!

Dec 06, 2018 16:19
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.