From 8cd03ba19ba5054821db0562ae4e8cdc9c889ce1 Mon Sep 17 00:00:00 2001 From: sokumon Date: Thu, 22 Jan 2026 03:06:01 +0530 Subject: [PATCH] fix: show misconfigured icons --- frappe/desk/doctype/desktop_icon/desktop_icon.py | 6 +----- frappe/desk/page/desktop/desktop.js | 13 +++++++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/frappe/desk/doctype/desktop_icon/desktop_icon.py b/frappe/desk/doctype/desktop_icon/desktop_icon.py index c636b679eb..03ab12e0aa 100644 --- a/frappe/desk/doctype/desktop_icon/desktop_icon.py +++ b/frappe/desk/doctype/desktop_icon/desktop_icon.py @@ -86,16 +86,13 @@ class DesktopIcon(Document): else: try: items = bootinfo.workspace_sidebar_item[self.label.lower()]["items"] - # - if len(items) == 0: - return False if len(items) and all(item["type"] == "Section Break" for item in items): return False return True except KeyError: - return False + return True def check_app_permission(self): for a in frappe.get_installed_apps(): @@ -193,7 +190,6 @@ def get_desktop_icons(user=None, bootinfo=None): permitted_icons = [] permitted_parent_labels = set() - if bootinfo: for s in user_icons: icon = frappe.get_doc("Desktop Icon", s) diff --git a/frappe/desk/page/desktop/desktop.js b/frappe/desk/page/desktop/desktop.js index 8fa8aa8c79..ffcc464e66 100644 --- a/frappe/desk/page/desktop/desktop.js +++ b/frappe/desk/page/desktop/desktop.js @@ -890,9 +890,6 @@ class DesktopIcon { if (this.icon_type == "Folder") { if (this.icon_data.child_icons.length == 0) return false; } - if (this.icon_type == "Link" && !this.icon_route) { - return false; - } return true; } get_child_icons_data() { @@ -999,7 +996,15 @@ class DesktopIcon { if (this.icon_route && this.icon_route.startsWith("http")) { this.icon.attr("target", "_blank"); } - this.icon.attr("href", this.icon_route); + if (this.icon_route) { + this.icon.attr("href", this.icon_route); + } else { + this.icon.on("click", function (event) { + frappe.msgprint( + "Icon is not correctly configured please check the workspace sidebar to it" + ); + }); + } } }