Skip to content

Commit

Permalink
Merge pull request #31 from 8848digital/461_resolve_search_link_field
Browse files Browse the repository at this point in the history
fix: replace comma to the blank value
  • Loading branch information
tinadn authored Nov 4, 2024
2 parents 5e5c76c + 664d531 commit 40430ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frappe/desk/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def search_widget(
order_by = f"`tab{doctype}`.idx desc, {order_by_based_on_meta}"

if not meta.translated_doctype:
_txt = frappe.db.escape((txt or "").replace("%", "").replace("@", ""))
_txt = frappe.db.escape((txt or "").replace("%", "").replace("@", "").replace(",",""))
# locate returns 0 if string is not found, convert 0 to null and then sort null to end in order by
_relevance = f"(1 / nullif(locate({_txt}, `tab{doctype}`.`name`), 0))"
formatted_fields.append(f"""{_relevance} as `_relevance`""")
Expand Down

0 comments on commit 40430ce

Please sign in to comment.