diff --git a/frappe/patches.txt b/frappe/patches.txt index ce0a749126..28bc5cb574 100644 --- a/frappe/patches.txt +++ b/frappe/patches.txt @@ -192,3 +192,4 @@ frappe.patches.v8_5.delete_email_group_member_with_invalid_emails frappe.patches.v8_x.update_user_permission frappe.patches.v8_5.patch_event_colors frappe.patches.v8_7.update_email_queue_status +frappe.patches.v8_10.delete_static_web_page_from_global_search diff --git a/frappe/patches/v8_10/__init__.py b/frappe/patches/v8_10/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/frappe/patches/v8_10/delete_static_web_page_from_global_search.py b/frappe/patches/v8_10/delete_static_web_page_from_global_search.py new file mode 100644 index 0000000000..336562c157 --- /dev/null +++ b/frappe/patches/v8_10/delete_static_web_page_from_global_search.py @@ -0,0 +1,5 @@ +from __future__ import unicode_literals +import frappe + +def execute(): + frappe.db.sql("""delete from `__global_search` where doctype='Static Web Page'"""); \ No newline at end of file diff --git a/frappe/utils/global_search.py b/frappe/utils/global_search.py index ea76247300..f9a07e3212 100644 --- a/frappe/utils/global_search.py +++ b/frappe/utils/global_search.py @@ -307,9 +307,11 @@ def search(text, start=0, limit=20, doctype=""): limit {start}, {limit}'''.format(start=start, limit=limit), (doctype, text), as_dict=True) for r in results: - if frappe.get_meta(r.doctype).image_field: - doc = frappe.get_doc(r.doctype, r.name) - r.image = doc.get(doc.meta.image_field) + try: + if frappe.get_meta(r.doctype).image_field: + r.image = frappe.db.get_value(r.doctype, r.name, frappe.get_meta(r.doctype).image_field) + except Exception: + frappe.clear_messages() return results