From f2fb42d237d8f000fc678c22a07aaad0b683e912 Mon Sep 17 00:00:00 2001 From: Renaud Le Gac <renaud.legac@free.fr> Date: Sat, 27 Nov 2010 17:51:34 +0000 Subject: [PATCH] Add a protection when customizing form related to the items parameter. --- modules/plugin_dbui/cfgsvc.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/plugin_dbui/cfgsvc.py b/modules/plugin_dbui/cfgsvc.py index fde33d7b..c9c16120 100644 --- a/modules/plugin_dbui/cfgsvc.py +++ b/modules/plugin_dbui/cfgsvc.py @@ -217,8 +217,18 @@ class CfgSvc(object): cfg['items'].append(self._getFormField(tablename, fieldname)) if fieldname == 'id': id_is_not_used = False - - cfg.update(fieldset.extjs) + + # protection when applying Ext JS configuration parameters + # NOTE: if the user submit a list of items they are append at the + # end of the current list. + # It is a way to add spacer and to fine tune the layout + di = dict(fieldset.extjs) + if 'items' in di: + cfg['items'].extend(di['items']) + del di['items'] + + # Apply the remaining Ext JS configuration parameters + cfg.update(di) li.append(cfg) if id_is_not_used: -- GitLab