libs/cbi: properly handle .default for dummy values
authorJo-Philipp Wich <jow@openwrt.org>
Sun, 8 Nov 2009 02:29:05 +0000 (02:29 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sun, 8 Nov 2009 02:29:05 +0000 (02:29 +0000)
libs/cbi/luasrc/view/cbi/dvalue.htm

index 819860a..9745fff 100644 (file)
@@ -15,8 +15,8 @@ $Id$
 
 <%+cbi/valueheader%>
 <% if self.href then %><a href="<%=self.href%>"><% end -%>
-       <%=pcdata(self:cfgvalue(section))%>
+       <%=pcdata(self:cfgvalue(section) or self.default or "")%>
 <%- if self.href then %></a><%end%>
 &#160;
-<input type="hidden" id="<%=cbid%>" value="<%=pcdata(self:cfgvalue(section))%>" />
+<input type="hidden" id="<%=cbid%>" value="<%=pcdata(self:cfgvalue(section) or self.default or "")%>" />
 <%+cbi/valuefooter%>