3

Anyone seen this weird gui-behaviour with Web 8 and a custom resolver ?

I wrote a custom resolver that, when a category is published, a specific page also gets published (to make life easy for editors). The resolver works fine - when i publish my category the page also gets published.

But, there's a minor annoyance, when I publish and click 'show items to publish', i get this

enter image description here

For some reason, the page title is not showing up (it is the correct page though, i verified in the broker which page gets published).

Also, when I debug my custom resolver, I can see the correct page being added to the list of resolved items.

enter image description here

My code is pretty simple

if(item is Category && item.Title.Equals(NAVIGATION_CATEGORY_NAME, StringComparison.InvariantCultureIgnoreCase))
{
        Page page = session.GetObject(new TcmUri(NAVIGATION_PAGE_ID, ItemType.Page, item.Id.PublicationId)) as Page;
        Template pageTemplate = session.GetObject(new TcmUri(NAVIGATION_PAGE_TEMPLATE_ID, ItemType.PageTemplate, item.Id.PublicationId)) as PageTemplate;
        resolvedItems.Add(new ResolvedItem(page, pageTemplate));
}
  • 1
    Try to load page after instantiating it: page.Load(LoadFlags.None); Your page object has only TCM URI pre-loaded and, the most probably, TCM doesn't force its reload to get title. – AntonM Jun 9 '16 at 8:52
  • 1
    yes, thank you, adding that line of code fixed the problem. The page title is now correctly showing in the list – Harald Hoffelinck Jun 9 '16 at 8:55
8

Try to load page after instantiating it:

page.Load(LoadFlags.None); 

Your page object has only TCM URI pre-loaded and TCM doesn't force its reload to get title.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.