From d5d217c5892e9487e0fd52d5eb73b0c298a5cbb7 Mon Sep 17 00:00:00 2001 From: nathan Date: Thu, 11 May 2023 10:56:42 -0600 Subject: [PATCH] Some "invalid option" fixes: - Don't notify user, just log it to the console - Fix calendar owner filtered out not loaded options --- api/js/etemplate/Et2Select/Et2Select.ts | 2 +- calendar/js/CalendarOwner.ts | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/api/js/etemplate/Et2Select/Et2Select.ts b/api/js/etemplate/Et2Select/Et2Select.ts index 057db70d57..86164dd7df 100644 --- a/api/js/etemplate/Et2Select/Et2Select.ts +++ b/api/js/etemplate/Et2Select/Et2Select.ts @@ -530,7 +530,7 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect) const missing = value.filter(v => !this.select_options.some(option => option.value == v)); if(missing.length > 0) { - this.helpText = this.egw().lang("Invalid option '%1' removed", missing.join(", ")); + console.warn("Invalid option '" + missing.join(", ") + " ' removed"); value = value.filter(item => missing.indexOf(item) == -1); } } diff --git a/calendar/js/CalendarOwner.ts b/calendar/js/CalendarOwner.ts index e18b237e49..e56c287cea 100644 --- a/calendar/js/CalendarOwner.ts +++ b/calendar/js/CalendarOwner.ts @@ -96,6 +96,19 @@ export class CalendarOwner extends Et2Select }); } + /** + * Check a value for missing options and remove them. + * + * Override to allow any value, since we won't have all options + * + * @param {string[]} value + * @returns {string[]} + */ + filterOutMissingOptions(value : string[]) : string[] + { + return value; + } + /** * Override icon for the select option to use lavatar *