From 76fee91a5093dfb67ab71c0e48bec2ab0efca7a8 Mon Sep 17 00:00:00 2001 From: ralf Date: Tue, 23 Jan 2024 15:18:16 +0200 Subject: [PATCH] check toolbar preference has a reasonable value: is a real object (not an array), strings e.g. stall the whole widget --- api/js/etemplate/et2_widget_toolbar.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/js/etemplate/et2_widget_toolbar.ts b/api/js/etemplate/et2_widget_toolbar.ts index d49b5cb8da..8e84d23cff 100644 --- a/api/js/etemplate/et2_widget_toolbar.ts +++ b/api/js/etemplate/et2_widget_toolbar.ts @@ -275,7 +275,11 @@ export class et2_toolbar extends et2_DOMWidget implements et2_IInput } let pref = (!egwIsMobile())? egw.preference(this.options.preference_id, this.options.preference_app): undefined; - if (pref && !jQuery.isArray(pref)) this.preference = pref; + // check pref has a reasonable value: is a real object (not an array), strings e.g. stall the whole widget + if (pref && typeof pref === 'object' && !Array.isArray(pref)) + { + this.preference = pref; + } //Set the default actions for the first time if (typeof pref === 'undefined' && !isDefault)