diff options
author | Ted Trask <ttrask01@yahoo.com> | 2015-06-05 22:12:42 -0400 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2015-06-05 22:12:42 -0400 |
commit | 10e49f14d9d219a961a414b8c346435dcfc3b95d (patch) | |
tree | 92f019dc082651d424c6901bbc4064edb73bc924 /lib | |
parent | be9beb6bf6d4688043d5f80b75bfb2aa6aa8670a (diff) | |
download | acf-core-10e49f14d9d219a961a414b8c346435dcfc3b95d.tar.bz2 acf-core-10e49f14d9d219a961a414b8c346435dcfc3b95d.tar.xz |
Use cfe.print_errtxt in htmlviewfunctions.displaycommandresults and make sure results are cfes
Diffstat (limited to 'lib')
-rw-r--r-- | lib/htmlviewfunctions.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/htmlviewfunctions.lua b/lib/htmlviewfunctions.lua index 3c9f34e..16a3945 100644 --- a/lib/htmlviewfunctions.lua +++ b/lib/htmlviewfunctions.lua @@ -329,7 +329,7 @@ function mymodule.displaycommandresults(commands, session, preserveerrors) local cmdresult = {} for i,cmd in ipairs(commands) do if session[cmd.."result"] then - cmdresult[#cmdresult + 1] = session[cmd.."result"] + cmdresult[#cmdresult + 1] = cfe(session[cmd.."result"]) if not preserveerrors or not session[cmd.."result"].errtxt then session[cmd.."result"] = nil end @@ -339,7 +339,7 @@ function mymodule.displaycommandresults(commands, session, preserveerrors) io.write('<div class="command-results"><h1>Command Result</h1>') for i,result in ipairs(cmdresult) do if type(result.value) == "string" and result.value ~= "" then io.write('<p>' .. string.gsub(html.html_escape(result.value), "\n", "<br/>") .. "</p>") end - mymodule.displayinfo(result) + if result.errtxt then io.write('<p class="error">' .. string.gsub(html.html_escape(result:print_errtxt()), "\n", "<br/>") .. '</p>') end end io.write('</div><!-- end .command-results -->') end |