This fixes the bug: https://bugzilla.proxmox.com/show_bug.cgi?id=677

Remarks:
* allowBlank is already set in the class definition
* The value of the comboBox can be either '' after the component initial
load, or 'null' if the user selected a macro and cleans the field afterwards.
This is the reason of the if (!value) test which will catch empty strings and
null.
---
 www/manager/grid/FirewallRules.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/www/manager/grid/FirewallRules.js 
b/www/manager/grid/FirewallRules.js
index ae53637..17f5411 100644
--- a/www/manager/grid/FirewallRules.js
+++ b/www/manager/grid/FirewallRules.js
@@ -164,10 +164,10 @@ Ext.define('PVE.FirewallRulePanel', {
                name: 'macro',
                value: '',
                fieldLabel: gettext('Macro'),
-               allowBlank: true,
+               editable: true,
                listeners: {
                    change: function(f, value) {
-                        if (value === '') {
+                        if (!value) {
                            me.down('field[name=proto]').setDisabled(false);
                            me.down('field[name=sport]').setDisabled(false);
                            me.down('field[name=dport]').setDisabled(false);
-- 
2.1.4


_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to