Open jrief opened 3 months ago
This is intentional. This allows navigation to not yet published pages using the menu when editing.
Note: The menu renderer of djangocms-versioning will be deprecated in the next version. It has performance issues. The core's menu renderer has been updated to work universally with and without versioning.
If you only want published pages also in edit mode, I suggest having a look here: https://github.com/django-cms/django-cms/blob/develop-4/cms/cms_menus.py
You can modify the if statement in lines 250ff. The default menus can be replaced, just like djangocms-versioning does replace them.
It might make sense to separate out the if statement (lines 250ff) into a separate method of the CMSMenu
class which would allow customization by subclassing.
How to reproduce:
get_nodes
fromCMSMenu
all descendant pages are returned, even those which have never been published.Expected behaviour:
The culprit is this line of code. In my opinion
states
should always be[constants.PUBLISHED]
, because if someone edits a page, he might be confused to get a different menu structure compared to the published version of that page.