From bc6ebbbc82836e0a28f76372ec32dcef1e83c37d Mon Sep 17 00:00:00 2001 From: Bread Genie Date: Tue, 7 Nov 2023 10:37:43 +0530 Subject: [PATCH] fix: add back `new_sidebar_items` to patch --- wiki/public/js/editor.js | 1 + wiki/wiki/doctype/wiki_page/wiki_page.py | 3 +++ 2 files changed, 4 insertions(+) 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)