ソースを参照

fix(Link): dont validate DocType when setting value (#18069)

(cherry picked from commit 1ea1d5de04)

Co-authored-by: Sagar Vora <sagar@resilient.tech>
version-14
mergify[bot] 2年前
committed by GitHub
コミット
465fb85d53
この署名に対応する既知のキーがデータベースに存在しません GPGキーID: 4AEE18F83AFDEB23
1個のファイルの変更10行の追加14行の削除
  1. +10
    -14
      frappe/public/js/frappe/form/controls/link.js

+ 10
- 14
frappe/public/js/frappe/form/controls/link.js ファイルの表示

@@ -89,23 +89,19 @@ frappe.ui.form.ControlLink = class ControlLink extends frappe.ui.form.ControlDat
is_translatable() {
return in_list(frappe.boot?.translated_doctypes || [], this.get_options());
}
set_link_title(value) {
let doctype = this.get_options();

if (!doctype) return;
async set_link_title(value) {
const doctype = this.get_options();

if (in_list(frappe.boot.link_title_doctypes, doctype)) {
let link_title = frappe.utils.get_link_title(doctype, value);
if (!link_title) {
link_title = frappe.utils.fetch_link_title(doctype, value).then((link_title) => {
this.translate_and_set_input_value(link_title, value);
});
} else {
this.translate_and_set_input_value(link_title, value);
}
} else {
if (!doctype || !in_list(frappe.boot.link_title_doctypes, doctype)) {
this.translate_and_set_input_value(value, value);
return;
}

const link_title =
frappe.utils.get_link_title(doctype, value) ||
(await frappe.utils.fetch_link_title(doctype, value));

this.translate_and_set_input_value(link_title, value);
}
translate_and_set_input_value(link_title, value) {
let translated_link_text = this.get_translated(link_title);


読み込み中…
キャンセル
保存