summaryrefslogtreecommitdiffstats
path: root/lib/htmlviewfunctions.lua
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2014-03-06 19:06:02 +0000
committerTed Trask <ttrask01@yahoo.com>2014-03-06 19:06:02 +0000
commit8259d0e26eb1e84266d8fd8f516927270aa92ac0 (patch)
tree5210d6882fb7c1221e85f74be6e81faf7b2621bc /lib/htmlviewfunctions.lua
parent880a940790f4ec625b2b07b15c98555365f847e7 (diff)
downloadacf-core-8259d0e26eb1e84266d8fd8f516927270aa92ac0.tar.bz2
acf-core-8259d0e26eb1e84266d8fd8f516927270aa92ac0.tar.xz
Fix issue in htmlviewfunctions where page_info nil exception
Diffstat (limited to 'lib/htmlviewfunctions.lua')
-rw-r--r--lib/htmlviewfunctions.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/htmlviewfunctions.lua b/lib/htmlviewfunctions.lua
index 89700ee..05fd97f 100644
--- a/lib/htmlviewfunctions.lua
+++ b/lib/htmlviewfunctions.lua
@@ -23,6 +23,7 @@ local function getlabel(myitem, value)
end
function mymodule.displayheader(myitem, page_info, header_level)
+ page_info = page_info or {}
header_level = header_level or page_info.header_level or 1
if 0 < header_level then
io.write("<h"..tostring(header_level)..">"..html.html_escape(myitem.label).."</h"..tostring(header_level)..">")
@@ -46,6 +47,7 @@ end
function mymodule.displayitem(myitem, header_level, page_info)
if not myitem then return end
+ page_info = page_info or {}
if myitem.type == "form" or myitem.type == "link" then
header_level = mymodule.displayheader(myitem, page_info, header_level)
mymodule.displayform(myitem, nil, nil, page_info, header_level)
@@ -109,7 +111,7 @@ function mymodule.displayformitem(myitem, name, viewtype, header_level, group)
myitem.disabled = "true"
end
if myitem.type == "group" then
- header_level = mymodule.displayheader(myitem, page_info, header_level)
+ header_level = mymodule.displayheader(myitem, nil, header_level)
mymodule.displayinfo(myitem)
mymodule.displayformcontents(myitem, nil, nil, mymodule.incrementheader(header_level), myitem.name)
elseif myitem.type == "multi" then