Merge pull request #15320 from ankush/fix/inconsistent_link_field_behaviour

fix: set invalid link fields to `undefined` instead `''`
This commit is contained in:
mergify[bot] 2021-12-15 17:41:46 +00:00 committed by GitHub
commit 20a2a2dd03
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -471,7 +471,7 @@ frappe.ui.form.ControlLink = class ControlLink extends frappe.ui.form.ControlDat
docname: value,
fields: columns_to_fetch,
}).then((response) => {
if (!response || !response.name) return "";
if (!response || !response.name) return null;
if (!docname || !columns_to_fetch.length) return response.name;
for (const [target_field, source_field] of Object.entries(fetch_map)) {