OrchardCMS / Orchard

Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform.
https://orchardproject.net
BSD 3-Clause "New" or "Revised" License
2.37k stars 1.12k forks source link

If MenuPart is a ContentMenuItem, check if the content is published before adding it to the NavigationBuilder #8653

Closed AndreaPiovanelli closed 1 year ago

AndreaPiovanelli commented 1 year ago

In reference to #8652 , checked if the content selected in the ContentPicker of the ContentMenuItem is published. This is done by checking for the Content LazyField of the part, which is loaded by ContentManager.Get(id) and so is null whenever the selected ContentItem isn't published.

This is done with dynamic variables to avoid referencing Orchard.ContentPicker.