luci-base: form.js: fix anonymous section table titles
authorJo-Philipp Wich <jo@mein.io>
Mon, 7 Oct 2019 17:46:57 +0000 (19:46 +0200)
committerJo-Philipp Wich <jo@mein.io>
Mon, 7 Oct 2019 17:49:58 +0000 (19:49 +0200)
When no section title is defined, the table renderer is supposed to use
the uci section id as fallback when the table section is not declared
to be anonymous.

Fixes: #3147
Fixes: a90bf384b ("luci-base: form.js: harmonize title property handling")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/form.js

index d5f9fe3c5203a3cf62504fd334773ca9a45f075f..f4cce17fe1409a532d5d7075f0cc492cd0817eff 100644 (file)
@@ -1031,6 +1031,9 @@ var CBITableSection = CBITypedSection.extend({
                for (var i = 0; i < nodes.length; i++) {
                        var sectionname = this.titleFn('sectiontitle', cfgsections[i]);
 
+                       if (sectionname == null)
+                               sectionname = cfgsections[i];
+
                        var trEl = E('div', {
                                'id': 'cbi-%s-%s'.format(config_name, cfgsections[i]),
                                'class': 'tr cbi-section-table-row',