From 55ba1b7a2fcbf5e6cca6fb22103b2bad74d783f6 Mon Sep 17 00:00:00 2001 From: "stravo1@mac" Date: Mon, 12 May 2025 21:37:30 +0530 Subject: [PATCH 1/3] fix: manually running custom homepage fields patch before this the patch was being skipped as while installing webshop the "Website Items" table would be created and thus the install script skipped all patches. but this patch is mandatory to be executed as without this patch the homepage overrides made for webshop misbehave. --- webshop/setup/install.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/webshop/setup/install.py b/webshop/setup/install.py index 7fb7bb3988..0ddc550f0e 100644 --- a/webshop/setup/install.py +++ b/webshop/setup/install.py @@ -6,6 +6,7 @@ def after_install(): + run_add_homepage_field_patch() run_patches() copy_from_ecommerce_settings() drop_ecommerce_settings() @@ -234,12 +235,21 @@ def say_thanks(): "convert_to_website_item_in_item_card_group_template", "shopping_cart_to_ecommerce", "copy_custom_field_filters_to_website_item", - "add_homepage_field", ] +def run_add_homepage_field_patch(): + # This is a mandatory patch that needs to be run. + # It adds necessary custom fields in the Homepage doctype (for v15) which prevents override/homepage.js from misbehaving + frappe.flags.in_patch = True + + try: + frappe.get_attr("webshop.patches.add_homepage_field.execute")() + + finally: + frappe.flags.in_patch = False + def run_patches(): # Customers migrating from v13 to v15 directly need to run all below patches - if frappe.db.table_exists("Website Item"): return From ac5d216e2ab4b3075487cbe7f6102d67cdf07143 Mon Sep 17 00:00:00 2001 From: "stravo1@mac" Date: Tue, 13 May 2025 15:12:35 +0530 Subject: [PATCH 2/3] fix: remove condition which checked for "Website Item" table create_website_items handles the check --- webshop/setup/install.py | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/webshop/setup/install.py b/webshop/setup/install.py index 0ddc550f0e..22833ad2fa 100644 --- a/webshop/setup/install.py +++ b/webshop/setup/install.py @@ -6,7 +6,6 @@ def after_install(): - run_add_homepage_field_patch() run_patches() copy_from_ecommerce_settings() drop_ecommerce_settings() @@ -235,23 +234,11 @@ def say_thanks(): "convert_to_website_item_in_item_card_group_template", "shopping_cart_to_ecommerce", "copy_custom_field_filters_to_website_item", + "add_homepage_field_patch" ] -def run_add_homepage_field_patch(): - # This is a mandatory patch that needs to be run. - # It adds necessary custom fields in the Homepage doctype (for v15) which prevents override/homepage.js from misbehaving - frappe.flags.in_patch = True - - try: - frappe.get_attr("webshop.patches.add_homepage_field.execute")() - - finally: - frappe.flags.in_patch = False - def run_patches(): # Customers migrating from v13 to v15 directly need to run all below patches - if frappe.db.table_exists("Website Item"): - return frappe.flags.in_patch = True From b2030af92ab700aad23dfe0345609b3e35e5bdf5 Mon Sep 17 00:00:00 2001 From: "stravo1@mac" Date: Tue, 13 May 2025 15:14:14 +0530 Subject: [PATCH 3/3] fix: remove condition which checked for "Website Item" table re: fix patch name --- webshop/setup/install.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webshop/setup/install.py b/webshop/setup/install.py index 22833ad2fa..72ed7e8fb0 100644 --- a/webshop/setup/install.py +++ b/webshop/setup/install.py @@ -234,7 +234,7 @@ def say_thanks(): "convert_to_website_item_in_item_card_group_template", "shopping_cart_to_ecommerce", "copy_custom_field_filters_to_website_item", - "add_homepage_field_patch" + "add_homepage_field" ] def run_patches():