luci-base: addressing this.vstack[0] is undefined.
authorJan Pazdziora <jan.pazdziora@code.adelton.com>
Fri, 10 Jan 2025 22:02:40 +0000 (23:02 +0100)
committerPaul Donald <newtwen+github@gmail.com>
Fri, 10 Jan 2025 22:14:49 +0000 (23:14 +0100)
Signed-off-by: Jan Pazdziora <jan.pazdziora@code.adelton.com>
applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js
modules/luci-base/htdocs/luci-static/resources/tools/widgets.js

index 99314bca5a106ac14b29f8c3173cc20f4fd95f8f..47b31cf0c19bbd6fa62c5f864ae41d071d808d1c 100644 (file)
@@ -130,7 +130,7 @@ return view.extend({
                o.placeholder = _('Unnamed zone');
                o.modalonly = true;
                o.rmempty = false;
-               o.datatype = L.hasSystemFeature('firewall4') ? '' : 'and(uciname,maxlength(11))';
+               o.datatype = L.hasSystemFeature('firewall4') ? 'uciname' : 'and(uciname,maxlength(11))';
                o.write = function(section_id, formvalue) {
                        var cfgvalue = this.cfgvalue(section_id);
 
index 7368d6c523cdab407c79b166b25dc0f17217b351..cd16227fc8299784563bbca0b50e88a2dc1fdb50 100644 (file)
@@ -148,7 +148,7 @@ var CBIZoneSelect = form.ListValue.extend({
                        display_items: this.display_size || this.size || 3,
                        dropdown_items: this.dropdown_size || this.size || 5,
                        validate: L.bind(this.validate, this, section_id),
-                       datatype: L.hasSystemFeature('firewall4') ? '' : 'and(uciname,maxlength(11))',
+                       datatype: L.hasSystemFeature('firewall4') ? 'uciname' : 'and(uciname,maxlength(11))',
                        create: !this.nocreate,
                        create_markup: '' +
                                '<li data-value="{{value}}">' +