AaronSadlerUK / Our.Umbraco.UmbNav

Drag and drop menu editor for Umbraco V8, V9 and V10+
MIT License
10 stars 15 forks source link

When there is any unpublished content, umbNav breaks: Failed to convert Meganav {ex} #63

Closed mrrm closed 2 years ago

mrrm commented 2 years ago

Which exact Umbraco version are you using? For example: 8.7.0 - don't just write v8 or v9

8.16

Bug summary

When the global nav contains unpublished items, the navigation disappears

Failed to convert Meganav "System.NullReferenceException: Object reference not set to an instance of an object. at Umbraco.Web.PublishedContentExtensions.GetCultureFromDomains(IPublishedContent content, Uri current) in D:\a\1\s\src\Umbraco.Web\PublishedContentExtensions.cs:line 202 at AaronSadler.MegaNavV8.Core.ValueConverters.MeganavV8ValueConverter.BuildMenu(IEnumerable1 items, Int32 level) at AaronSadler.MegaNavV8.Core.ValueConverters.MeganavV8ValueConverter.BuildMenu(IEnumerable1 items, Int32 level) at AaronSadler.MegaNavV8.Core.ValueConverters.MeganavV8ValueConverter.BuildMenu(IEnumerable`1 items, Int32 level) at AaronSadler.MegaNavV8.Core.ValueConverters.MeganavV8ValueConverter.ConvertIntermediateToObject(IPublishedElement owner, IPublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, Object inter, Boolean preview)"

Specifics

Tested in Chrome and Firefox

Steps to reproduce

Create a navigation map where a page is unpublished

Expected result / actual result

Expected: When there is an unpublished page in the navigation, it just musn´t be showed in the menu, not break the navigation menu Actual: Instead of returning {System.Linq.Enumerable.WhereListIterator} it returns {AaronSadler.MegaNavV8.Core.Models.MeganavV8Item[0]} despite many others published pages in the navigation Actual:

AaronSadlerUK commented 2 years ago

Sorry for the delay, I will look into this today 🙂

AaronSadlerUK commented 2 years ago

@mrrm Can you confirm you are using the latest version of UmbNav and not MegaNavV8

UmbNav superseeded MegaNavV8 early last year

mrrm commented 2 years ago

Hi @AaronSadlerUK . I've tried with the latest version of UmbNav as well. Same issue with unpublished pages in the menu.

AaronSadlerUK commented 2 years ago

@mrrm I haven't been able to replicate this, I have added an additional check in 1.1.1 (which i released within the last half hour) try that.

Otherwise I'll need more info / examples to debug further

mrrm commented 2 years ago

@AaronSadlerUK thanks. this issue got away when I updated the package