diff --git a/wiki/public/js/editor.js b/wiki/public/js/editor.js index 132b4179..e820041c 100644 --- a/wiki/public/js/editor.js +++ b/wiki/public/js/editor.js @@ -65,6 +65,7 @@ const saveWikiPage = (draft = false) => { message: `${isEmptyEditor ? "Created" : "Edited"} ${title}`, content, new: isEmptyEditor, + new_sidebar_items: isEmptyEditor ? getSidebarItems() : "", title, draft, new_sidebar_group: isEmptyEditor ? urlParams.get("newWiki") : "", diff --git a/wiki/wiki/doctype/wiki_page/wiki_page.py b/wiki/wiki/doctype/wiki_page/wiki_page.py index ef2a86b7..7e20ea3a 100644 --- a/wiki/wiki/doctype/wiki_page/wiki_page.py +++ b/wiki/wiki/doctype/wiki_page/wiki_page.py @@ -447,6 +447,7 @@ def update( wiki_page_patch=None, new=False, new_sidebar_group="", + new_sidebar_items="", draft=False, ): context = {"route": name} @@ -465,6 +466,7 @@ def update( patch.message = message patch.new = new patch.new_sidebar_group = new_sidebar_group + patch.new_sidebar_items = new_sidebar_items patch.save() else: @@ -479,6 +481,7 @@ def update( "new": new, "new_title": title, "new_sidebar_group": new_sidebar_group, + "new_sidebar_items": new_sidebar_items, } patch.update(patch_dict)