Skip to content

Commit b67d42e

Browse files
mihir-kandoimergify[bot]
authored andcommitted
fix: link field displays incorrect value when empty
(cherry picked from commit db00860)
1 parent 62f5873 commit b67d42e

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

erpnext/public/js/utils.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,12 +1073,14 @@ frappe.form.link_formatters["Project"] = function (value, doc, df) {
10731073
* @returns {string} - The link value with the added title.
10741074
*/
10751075
function add_link_title(value, doc, df, title_field) {
1076-
if (doc && value && doc[title_field] && doc[title_field] !== value && doc[df.fieldname] === value) {
1077-
return value + ": " + doc[title_field];
1078-
} else if (!value && doc.doctype && doc[title_field] && doc.doctype == df.parent) {
1079-
return doc[title_field];
1080-
} else {
1081-
return value;
1076+
if (value && doc[title_field]) {
1077+
if (doc[title_field] !== value && doc[df.fieldname] === value) {
1078+
return value + ": " + doc[title_field];
1079+
} else if (doc.doctype == df.parent) {
1080+
return doc[title_field];
1081+
} else {
1082+
return value;
1083+
}
10821084
}
10831085
}
10841086

0 commit comments

Comments
 (0)