From 1076b25d1c96157190c1c29f7babc90991c33cde Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Thu, 21 Feb 2019 09:23:37 +0530 Subject: [PATCH 1/5] fix: Check option length in condition --- frappe/public/js/frappe/form/controls/multiselect.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/form/controls/multiselect.js b/frappe/public/js/frappe/form/controls/multiselect.js index bc4f09468b..610460f2d2 100644 --- a/frappe/public/js/frappe/form/controls/multiselect.js +++ b/frappe/public/js/frappe/form/controls/multiselect.js @@ -35,7 +35,7 @@ frappe.ui.form.ControlMultiSelect = frappe.ui.form.ControlAutocomplete.extend({ get_value() { let data = this._super(); // find value of label from option list and return actual value string - if (this.df.options && this.df.options[0].label) { + if (this.df.options.length && this.df.options[0].label) { data = data.split(',').map(op => op.trim()); data = data.map(val => { let option = this.df.options.find(op => op.label === val); From 9bb614e93dd0b4413a1253ede499d80343a07d7c Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Thu, 21 Feb 2019 09:35:05 +0530 Subject: [PATCH 2/5] fix: Check if options exists in df or not" --- frappe/public/js/frappe/form/controls/multiselect.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/form/controls/multiselect.js b/frappe/public/js/frappe/form/controls/multiselect.js index 610460f2d2..c025075798 100644 --- a/frappe/public/js/frappe/form/controls/multiselect.js +++ b/frappe/public/js/frappe/form/controls/multiselect.js @@ -35,7 +35,7 @@ frappe.ui.form.ControlMultiSelect = frappe.ui.form.ControlAutocomplete.extend({ get_value() { let data = this._super(); // find value of label from option list and return actual value string - if (this.df.options.length && this.df.options[0].label) { + if (this.df.options && this.df.options.length && this.df.options[0].label) { data = data.split(',').map(op => op.trim()); data = data.map(val => { let option = this.df.options.find(op => op.label === val); From 357568661859773b4fe098ff216096e42e3ca6e0 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 21 Feb 2019 13:03:45 +0530 Subject: [PATCH 3/5] fix: email button not working --- frappe/public/js/frappe/form/controls/multiselect.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/public/js/frappe/form/controls/multiselect.js b/frappe/public/js/frappe/form/controls/multiselect.js index bc4f09468b..1109083f5c 100644 --- a/frappe/public/js/frappe/form/controls/multiselect.js +++ b/frappe/public/js/frappe/form/controls/multiselect.js @@ -35,7 +35,7 @@ frappe.ui.form.ControlMultiSelect = frappe.ui.form.ControlAutocomplete.extend({ get_value() { let data = this._super(); // find value of label from option list and return actual value string - if (this.df.options && this.df.options[0].label) { + if (this.df && this.df.options.length && this.df.options[0].label) { data = data.split(',').map(op => op.trim()); data = data.map(val => { let option = this.df.options.find(op => op.label === val); @@ -48,7 +48,7 @@ frappe.ui.form.ControlMultiSelect = frappe.ui.form.ControlAutocomplete.extend({ set_formatted_input(value) { if (!value) return; // find label of value from option list and set from it as input - if (this.df.options && this.df.options[0].label) { + if (this.df && this.df.options.length && this.df.options[0].label) { value = value.split(',').map(d => d.trim()).map(val => { let option = this.df.options.find(op => op.value === val); return option ? option.label : val; From 1e3ee5db9beca0aba66192a9d5ac347a03a77dc3 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 21 Feb 2019 13:15:07 +0530 Subject: [PATCH 4/5] code cleanup --- frappe/public/js/frappe/form/controls/multiselect.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/public/js/frappe/form/controls/multiselect.js b/frappe/public/js/frappe/form/controls/multiselect.js index 1109083f5c..64ca4fc83d 100644 --- a/frappe/public/js/frappe/form/controls/multiselect.js +++ b/frappe/public/js/frappe/form/controls/multiselect.js @@ -35,7 +35,7 @@ frappe.ui.form.ControlMultiSelect = frappe.ui.form.ControlAutocomplete.extend({ get_value() { let data = this._super(); // find value of label from option list and return actual value string - if (this.df && this.df.options.length && this.df.options[0].label) { + if (this.df.options && this.df.options.length && this.df.options[0].label) { data = data.split(',').map(op => op.trim()); data = data.map(val => { let option = this.df.options.find(op => op.label === val); @@ -48,7 +48,7 @@ frappe.ui.form.ControlMultiSelect = frappe.ui.form.ControlAutocomplete.extend({ set_formatted_input(value) { if (!value) return; // find label of value from option list and set from it as input - if (this.df && this.df.options.length && this.df.options[0].label) { + if (this.df.options && this.df.options.length && this.df.options[0].label) { value = value.split(',').map(d => d.trim()).map(val => { let option = this.df.options.find(op => op.value === val); return option ? option.label : val; From dd328340c27625ccc84b064c5c6c7ae2f00bb6fb Mon Sep 17 00:00:00 2001 From: Saurabh Date: Thu, 21 Feb 2019 16:48:15 +0600 Subject: [PATCH 5/5] bumped to version 11.1.9 --- frappe/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/__init__.py b/frappe/__init__.py index 3dc745e760..44f434faff 100644 --- a/frappe/__init__.py +++ b/frappe/__init__.py @@ -24,7 +24,7 @@ if sys.version[0] == '2': reload(sys) sys.setdefaultencoding("utf-8") -__version__ = '11.1.8' +__version__ = '11.1.9' __title__ = "Frappe Framework" local = Local()