fix: global search index breaking on long titles
If you created a doc with a title longer than 140 characters, it's supposed to be truncated to 140. However, the global search index would break for that doctype due to an error in the query. The truncate was happening AFTER it was escaped, causing it to lose the closing quote mark which caused a SQL error and broke the index.
This commit is contained in:
parent
4ac83a0cc8
commit
ecfc0714bc
1 changed files with 2 additions and 2 deletions
|
|
@ -137,8 +137,8 @@ def rebuild_for_doctype(doctype):
|
|||
"name": frappe.db.escape(doc.name),
|
||||
"content": frappe.db.escape(' ||| '.join(content or '')),
|
||||
"published": published,
|
||||
"title": frappe.db.escape(title or '')[:int(frappe.db.VARCHAR_LEN)],
|
||||
"route": frappe.db.escape(route or '')[:int(frappe.db.VARCHAR_LEN)]
|
||||
"title": frappe.db.escape((title or '')[:int(frappe.db.VARCHAR_LEN)]),
|
||||
"route": frappe.db.escape((route or '')[:int(frappe.db.VARCHAR_LEN)])
|
||||
})
|
||||
if all_contents:
|
||||
insert_values_for_multiple_docs(all_contents)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue