fix: link field displays incorrect value when empty

(cherry picked from commit db00860662)
This commit is contained in:
Mihir Kandoi
2026-02-23 17:50:24 +05:30
committed by Mergify
parent 62f587318c
commit b67d42ee58

View File

@@ -1073,12 +1073,14 @@ frappe.form.link_formatters["Project"] = function (value, doc, df) {
* @returns {string} - The link value with the added title.
*/
function add_link_title(value, doc, df, title_field) {
if (doc && value && doc[title_field] && doc[title_field] !== value && doc[df.fieldname] === value) {
return value + ": " + doc[title_field];
} else if (!value && doc.doctype && doc[title_field] && doc.doctype == df.parent) {
return doc[title_field];
} else {
return value;
if (value && doc[title_field]) {
if (doc[title_field] !== value && doc[df.fieldname] === value) {
return value + ": " + doc[title_field];
} else if (doc.doctype == df.parent) {
return doc[title_field];
} else {
return value;
}
}
}