Bug? MenuService > GetMenuItemsForContent

Topics: Troubleshooting
Apr 30, 2012 at 5:15 PM
Edited Apr 30, 2012 at 5:16 PM

Working with version 1.3.0

Problem appears on any content that has the menu relation part. Issue is many menu items have a relatedcontentid of 0, but GetMenuItemsForContent fires on item creation, where the content item also has an ID of 0. This means the first item from a given menu always appears checked during content creation and can cause some nasty side effects if not unchecked before saving/publishing.

I did make the following fix which seems to have no side effects:

GetMenuItemsForContent - (contentItem.Id != 0 added to original code)

                    return _contentManager.Value
                        .Query<AdvancedMenuItemPart, AdvancedMenuItemPartRecord>()
                        .Where(i => contentItem.Id != 0 && i.RelatedContentId == contentItem.Id )
                        .List();

 

I have not checked the new version to see if it has the behavior I was seeing, so this whole post might not mean a whole lot. Dunno.

Coordinator
May 2, 2012 at 12:58 AM

Thanks for the info - will integrate your fix.